OK論壇

 找回密碼
 註冊
查看: 4419|回復: 7

SQL註冊網頁 帳號註冊 一直出現註冊失敗,請重新填寫資料

 關閉 [複製鏈接]
  • TA的每日心情
    擦汗
    2010-7-1 12:18 AM
  • 簽到天數: 49 天

    連續簽到: 0 天

    [LV.5]常住居民I

    發表於 2010-6-6 17:07:44 | 顯示全部樓層 |閱讀模式
    我自己弄得註冊網頁
     
    開放給朋友先註冊 有人卻回報說 註冊失敗,請重新填寫資料
     
    我自己也測試 一樣=ˇ=
     
    是甚麼問題呢@@?
     
    好困擾阿 我用的是 有身分證註冊的那版本 我也有把身分證驗證拿掉
     
    問題一樣所在 請大大指點一下
    回復

    使用道具 舉報

  • TA的每日心情
    擦汗
    2010-7-1 12:18 AM
  • 簽到天數: 49 天

    連續簽到: 0 天

    [LV.5]常住居民I

     樓主| 發表於 2010-6-6 18:35:44 | 顯示全部樓層
    我的 註冊網頁的 檔案 register
    <?PHP
    $title = "帳號註冊";
    require './inc/header.inc';
    $id = $_POST["id"];
    $pass1 = $_POST["pass"];
    $pass2 = $_POST["passr"];
    $email = $_POST["email"];
    $sex = $_POST["sex"];
    $idcard = $_POST["idcard"];

    if(!$_POST['act'] && $ruleopen == "1" && $_POST["rule"] != "ok"){
    echo "
    <form name='urlto' method = 'POST' action = 'register.php'>
    <p align='center'>
    <div style='overflow: auto; width: 500px; height: 400px; border-collapse: collapse'>";
    require './inc/rule.inc';
    echo "
    </div></p>
    <input type='hidden' name='rule' value='ok'>
    <center>
    <font color='#FF0000'><b>註冊前請先同意本條款</b></font><br>
    <input class=btn style='HEIGHT: 23px' type=submit class=bginput value='同 意' name=rulesubmit>
    <input class=btn style='HEIGHT: 23px' onclick=javascript:history.go(-1); type=button value=不同意 name=return>
    </center>
    </from>";
    require './inc/footer.inc'; exit;
    }

    if ($idreg == "1"){
    $idcardreg = "</font></td></tr><tr ><td height=\"24\"><p align=\"right\"><font size=\"-1\" face=\"Tahoma, sans-serif\"><b>身分證字號:</b></font></p></td><td height=\"24\"><font size=\"-1\" face=\"Tahoma, sans-serif\">
    <input type='password' name='idcard' style='background-color:rgb(255,255,255); border-width:1; border-color:gray; border-style:solid;' size=16 maxlength=$idcardnum>";
    }
    if (empty($_POST['act'])) {
    echo "<table border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">
    <form action='register.php' method='post' name=\"regForm\" id=\"regForm\"><tr>
    <td height=\"24\"><p align=\"right\"><input type='hidden' name='act' value='register'><font size=\"-1\" face=\"Tahoma, sans-serif\"><b>用戶名:</b></font></p></td><td height=\"24\"><font size=\"-1\" face=\"Tahoma, sans-serif\">
    <input type='text' name='id' style='background-color:rgb(255,255,255); border-width:1; border-color:gray; border-style:solid;' size=16 maxlength=24>
    </font> </td></tr><tr ><td height=\"24\"><p align=\"right\"><font size=\"-1\" face=\"Tahoma, sans-serif\"><b>密碼:</b></font></p></td><td height=\"24\"><font size=\"-1\" face=\"Tahoma, sans-serif\">
    <input type='password' name='pass' style='background-color:rgb(255,255,255); border-width:1; border-color:gray; border-style:solid;' size=16 maxlength=24>
    </font> </td></tr><tr ><td height=\"24\"><p align=\"right\"><font size=\"-1\" face=\"Tahoma, sans-serif\"><b>確認密碼:</b></font></p></td><td height=\"24\"><font size=\"-1\" face=\"Tahoma, sans-serif\">
    <input type='password' name='passr' style='background-color:rgb(255,255,255); border-width:1; border-color:gray; border-style:solid;' size=16 maxlength=24>
    $idcardreg
    </font></td></tr><tr ><td height=\"24\"><p align=\"right\"><font size=\"-1\" face=\"Tahoma, sans-serif\"><b>E-mail:</b></font></p></td><td height=\"24\"><font size=\"-1\" face=\"Tahoma, sans-serif\">
    <input type='text' name='email' style='background-color:rgb(255,255,255); border-width:1; border-color:gray; border-style:solid;' size=25>
    </font></td></tr><tr ><td height=\"21\"><p align=\"right\"><font size=\"-1\" face=\"Tahoma, sans-serif\"><b>性別:</b></font></p></td>
    <td height=\"21\"><font size=\"-1\" face=\"Tahoma, sans-serif\"><input type='radio' name=\"sex\" value=M checked>男<input type='radio' name=\"sex\" value=F>女</font></td>
    </tr><tr ><td height=\"24\"><font face=\"Tahoma, sans-serif\">&nbsp;</font></td><td height=\"24\"><font face=\"Tahoma, sans-serif\">
    <input name=\"imageField\" type=\"submit\" value=\"申請註冊\" border=\"0\"></font></td></tr></form></table>";require './inc/footer.inc';}
    else{
    if ($id>='A' && $id<='Z') {echo "<div align='center'><font color='#ff0000'>請使用小寫的英文字母作為用戶名</font></div>"; require './inc/footer.inc'; exit;}
    if (!isAlNum($id)) {echo "<div align='center'><font color='#ff0000'>請使用數字或英文作用戶名</font></div>"; require './inc/footer.inc'; exit;}
    if (strlen($id) <4) {echo "<div align='center'><font color='#ff0000'>用戶名不得少於4個字符</font></div>"; require './inc/footer.inc'; exit;}
    if (empty($id) or empty($pass1) or empty($pass2) or empty($email)) {echo "<div align='center'><font color='#ff0000'>你的用戶名•密碼或E-mail沒有填寫</font></div>"; require './inc/footer.inc'; exit;}
    if(empty($email) || !ereg("^[-a-zA-Z0-9_\.]+\@([0-9A-Za-z][0-9A-Za-z-]+\.)+[A-Za-z]{2,5}$",$email)) {echo "<div align='center'><font color='#ff0000'>您的E-mail格式錯誤</font></div>"; require './inc/footer.inc'; exit;}
    if ($idreg == "1" && empty($idcard)) {echo "<div align='center'><font color='#ff0000'>你的身分證字號沒有填寫</font></div>"; require './inc/footer.inc'; exit;}
    if ($idreg == "1" && strlen($idcard) < $idcardnum)  {echo "<div align='center'><font color='#ff0000'>你的身分證字號少於 $idcardnum 個字元</font></div>"; require './inc/footer.inc'; exit;}
    if ($idreg == "1" && $idcheak == "1"){require './inc/idcheak.inc';}
    if ($pass1 != $pass2) {        echo "<div align='center'><font color='#ff0000'>兩次密碼輸入不符</font></div>";        require './inc/footer.inc';        exit;}
    $que="select userid from login where userid='$id'";
    $check = mysql_query($que,$connect);
    $total_count = mysql_affected_rows();
    if($total_count>=1) {echo "<div align='center'><font color='#ff0000'>你註冊的用戶名已存在</font></div>";        require './inc/footer.inc'; exit;}
    $que="select userid from login where userid='$id'";
    $check = mysql_query($que,$connect);
    if ($idreg == "1" && $idrereg == "0"){
    $que="select idcard from login where idcard='$idcard'";
    $check = mysql_query($que,$connect);
    $total_count = mysql_affected_rows();
    if($total_count>=1) {echo "<div align='center'><font color='#ff0000'>你註冊的身分證字號已存在</font></div>";        require './inc/footer.inc'; exit;}
    }
    if ($mailrereg == "0"){
    $que="select email from login where email='$email'";
    $check = mysql_query($que,$connect);
    $total_count = mysql_affected_rows();
    if($total_count>=1) {echo "<div align='center'><font color='#ff0000'>你註冊的E-mail已存在</font></div>";        require './inc/footer.inc'; exit;}
    }
    if ($idreg == "0"){$idcard = "0";}
    $query="insert into login (userid, user_pass, sex, email, idcard) values ('$id','$pass1','$sex','$email','$idcard')";
    $result = mysql_query($query);
    if ($result) {
    echo "<div align='center'><font color='#ff0000'>註冊成功,趕快加入遊戲吧</font></div>";        require './inc/footer.inc'; exit;        }else{
    echo "<div align='center'><font color='#ff0000'>註冊失敗,請重新填寫資料</font></div>";        require './inc/footer.inc'; exit;}}
    ?>
    回復 支持 反對

    使用道具 舉報

  • TA的每日心情

    2020-11-19 04:46 PM
  • 簽到天數: 2823 天

    連續簽到: 3 天

    [LV.Master]伴壇終老

    發表於 2010-6-6 19:49:46 | 顯示全部樓層
    他應該說過數據庫要先更新吧?
    http://你的IP/你的註冊網頁資料夾名稱/install.php
    回復 支持 反對

    使用道具 舉報

  • TA的每日心情
    開心
    2024-9-6 01:09 AM
  • 簽到天數: 1324 天

    連續簽到: 1 天

    [LV.10]以壇為家III

    發表於 2010-6-6 20:35:18 | 顯示全部樓層
    說明都不看 腦筋都不動 也不爬文 把問題丟 給別人比較快?

    請問一下 他附說明是寫給誰看的?
    回復 支持 反對

    使用道具 舉報

  • TA的每日心情
    擦汗
    2010-7-1 12:18 AM
  • 簽到天數: 49 天

    連續簽到: 0 天

    [LV.5]常住居民I

     樓主| 發表於 2010-6-6 23:21:27 | 顯示全部樓層
    謝謝
    剛剛還不知道怎更新
    打了四五個網址才正確=ˇ=
    謝謝,原來是要更新資料庫
    我第一次弄網頁註冊 有點白痴問題 請見諒
    因為我以為 都可以使用也看的到 因該是升級好了
     
    還有我的遊戲排行榜上
    出現一大串英文是怎麼了?
     
    Strict Standards: date() [function.date]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for '8.0/no DST' instead in C:\AppServ\www\register.com.hk\list.php on line 35
    回復 支持 反對

    使用道具 舉報

  • TA的每日心情
    開心
    2024-9-6 01:09 AM
  • 簽到天數: 1324 天

    連續簽到: 1 天

    [LV.10]以壇為家III

    發表於 2010-6-6 23:47:46 | 顯示全部樓層
    本帖最後由 sinya 於 2010-6-7 12:06 AM 編輯

    意思是你 35 行 時間 fuction 太舊 要換新的語法 比較安全 請貼一下 list.php 語法


    時間涵數 換成這樣
    date_default_timezone_set("Asia/Taipei");


    我參考這裡的 要看自已看說明 應該是可以 我以前有改過
    http://www.w3schools.com/php/func_date_default_timezone_set.asp

    區域時間格式 我們是亞洲 台北
    http://www.php.net/manual/en/timezones.asia.php
    回復 支持 反對

    使用道具 舉報

  • TA的每日心情

    2010-6-7 01:51 AM
  • 簽到天數: 28 天

    連續簽到: 0 天

    [LV.4]偶爾看看III

    發表於 2010-6-8 06:51:48 | 顯示全部樓層
    沿海的作品  

    最近很熱喔  都用在一些大服上了
    回復 支持 反對

    使用道具 舉報

  • TA的每日心情

    2020-11-19 04:46 PM
  • 簽到天數: 2823 天

    連續簽到: 3 天

    [LV.Master]伴壇終老

    發表於 2010-6-8 13:19:16 | 顯示全部樓層
    沿海的作品  

    最近很熱喔  都用在一些大服上了
    威寶傳說 發表於 2010-6-8 06:51 AM



        你好像在做無意義回復
    回復 支持 反對

    使用道具 舉報

    您需要登錄後才可以回帖 登錄 | 註冊

    本版積分規則

    Archiver|手機版|小黑屋|OK討論區

    GMT+8, 2025-7-6 12:24 PM , Processed in 0.351691 second(s), 19 queries , Gzip On.

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回復 返回頂部 返回列表