UID324127
帖子
精華
主題
積分527
現金
積極性
威望
違規
熱心
推廣次數
閱讀權限10
註冊時間2014-2-23
在線時間 小時
最後登錄1970-1-1
TA的每日心情 | 郁悶 2016-10-5 03:30 AM |
---|
簽到天數: 248 天 連續簽到: 1 天 [LV.8]以壇為家I
|
本帖最後由 fong0319 於 2014-4-20 10:07 PM 編輯
各位大大我又來了 這次 真的要麻煩各位了
私服 開機 已處理完畢 還先謝謝幫助的大大們
但現在遇到困難了
用PHP做的 註冊網頁 無法註冊帳號 然後 別人也連不進來
我用PHP架的網頁 網址如下
http://catvillage.hopto.org/index2/
第一次用這個 還不知要請大大們看哪裡出問題
如有沒放到的還請見諒
這張是 一直 註冊失敗
之後是 PHP這個
最後 這是小的分享器設定 如有錯誤 請跟我說 謝謝
config.php- <?PHP
- //提醒您請務必先執行http://catvillage.hopto.org/install.php進行資料庫升級
- //---------------------伺服器設置---------------------
- $dbHost = "localhost"; //數據庫位址
- $dbName = "main"; //RO數據庫
- $dbUser = "root"; //數據庫帳號
- $dbPasswd = "root"; //數據庫密碼
- $loginip = "catvillage.hopto.org"; //LOGIN的IP
- $charip = "catvillage.hopto.org"; //CHAR的IP
- $mapip = "catvillage.hopto.org"; //MAP的IP
- $loginport = "6900"; //LOGIN的端口
- $charport = "6121"; //CHAR的端口
- $mapport = "5121"; //MAP的端口
- //--------------------網頁相關設置--------------------
- $ROname = "Cat Village"; //伺服器名稱
- $Weltext = "Welcome to Cat Village Ragnarok";//歡迎語句
- $Indexurl = "http://catvillage.hopto.org/index2/"; //主頁位址
- $bbsurl = "852/"; //論壇位址
- $logo = "img/QRO.jpg"; //頂部LOGO位址
- $header_ground = "img/top_bg.gif"; //頂部背景位址
- $page_ground = "img/bg_img.gif"; //網頁底部位址
- $adv = "0"; //adv.js網頁圖片開關(0 = 關閉, 1 = 開啟)
- $charset = "big5"; //MYSQL編碼設置(請參考下方語系名稱)
- //繁體中文 => big5
- //簡體中文 => gb2312
- //西歐字符(ISO) => latin1
- //----------------------補丁設置----------------------
- $patchver = ""; //補丁說明
- $patchtxt = ""; //補丁文件名
- $patchbig = ""; //補丁大小
- $patchurl = ""; //補丁位址
- //--------------------註冊相關設置--------------------
- $ruleopen = "1"; //是否開啟註冊條款功能(0 = 關閉, 1 = 開啟)[內容請更改inc/rule.inc文件]
- $mailrereg = "1"; //同一組E-mail是否允許重複註冊(0 = 不允許, 1 = 允許)
- //---------------------排行榜設置---------------------
- $onlinelist = "1"; //排行榜是否顯示在線玩家列表(0 = 關閉, 1 = 開啟)
- $listn = "100"; //排行顯示行數(建議值:20)
- $listn2 = "120"; //在線玩家顯示行數
- $listncash = "1"; //排行榜是否顯示玩家身上金錢(0 = 關閉, 1 = 開啟)
- $listidout = ""; //屏障玩家account_id(請以半形逗號","作為分界,留空則關閉此功能。)
- //-------------------排行榜緩存設置-------------------
- //緩存Cache技術: 減少因網路頻寬或通訊品質所造成使用者的等待時間,亦可降低對伺服器資料庫連線次數。
- $cacheopen = "1"; //是否開啟排行榜緩存系統(0 = 關閉, 1 = 開啟)
- $lvlisttime = "3600"; //玩家等級排行榜緩存時間(單位:秒)
- $onlinetime = "60"; //在線玩家排行緩存時間(單位:秒)
- //-------------------身分證系統設置-------------------
- $idreg = "0"; //是否開啟身分證字號系統(0 = 關閉, 1 = 開啟)
- $idrereg = "1"; //同一組身分證字號是否允許重複註冊(0 = 不允許, 1 = 允許)
- $reidcard = "1"; //是否開啟身分證字號回填系統(0 = 關閉, 1 = 開啟)
- $idcardnum = "10"; //身分證字號需求字元
- $idcheak = "0"; //是否驗證身分證字號公式[台灣版] (0 = 關閉, 1 = 開啟)
- //----------------------其它設置----------------------
- $not_use="job_wiz.gat"; //黑房地圖
- /********************************\
- **********************************
- **********************************
- **********下面為默認參數**********
- **********************************
- **********************************
- \********************************/
- $dbConid=$connect;
- $connect=mysql_pconnect($dbHost,$dbUser,$dbPasswd) or die("無法連接數據庫!");
- mysql_select_db($dbName) or die("數據庫名可能有誤!");
- function writeover($filename,$data,$method='rb+',$iflock=1,$check=1,$chmod=1){
- $check && strpos($filename,'..')!==false && exit('Forbidden');
- touch($filename);
- $handle = fopen($filename,$method);
- $iflock && flock($handle,LOCK_EX);
- fwrite($handle,$data);
- $method=='rb+' && ftruncate($handle,strlen($data));
- fclose($handle);
- $chmod && @chmod($filename,0777);
- }
- function URL_Refresh($url) {
- print "<html><head><META HTTP-EQUIV=Refresh CONTENT="0;url='$url'"></head></html>";
- // Header("Location: $url");
- }
- function isAlNum($str) {
- if(eregi("[^0-9a-zA-Z]",$str)) return 0;
- return 1;
- }
- function ismail( $str ) {
- if( eregi("([a-z0-9\_\-\.]+)@([a-z0-9\_\-\.]+)", $str) ) return true;
- else return false;
- }
- ?>
複製代碼 register.php- <?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>
- <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;
- }
- $id = $_POST["id"];
- $pass1 = $_POST["pass"];
- $pass2 = $_POST["passr"];
- $email = $_POST["email"];
- $sex = $_POST["sex"];
- 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">用戶名: </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">密碼: </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">確認密碼: </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>
- </font></td></tr><tr ><td height="24"><p align="right"><font size="-1" face="Tahoma, sans-serif">E-mail: </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 maxlength=25>
- </font></td></tr><tr ><td height="21"><p align="right"><font size="-1" face="Tahoma, sans-serif">性別: </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"> </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 (!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'>你的用戶名/密碼或EMAIL沒有填寫</font></div>"; require './inc/footer.inc'; exit;}
- if ($pass1 != $pass2) { echo "<div align='center'><font color='#ff0000'>兩次密碼輸入不符</font></div>"; require './inc/footer.inc'; exit;}
- $que1="select userid from login where userid='$id'";
- $check = mysql_query($que1,$connect);
- $total_count = mysql_affected_rows();
- if($total_count>=1) {echo "<div align='center'><font color='#ff0000'>你註冊的用戶名已存在</font></div>"; require './inc/footer.inc'; exit;}
- $query="insert into login (account_id, userid, user_pass, sex, email,level) values ('$accountno','$id','$pass1','$sex','$email','0')";
- $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;}}
- ?>
複製代碼 |
|