Помогите создать акк у мня ниче неполучаеться.Я создавал акк с помощу mueditor-a создал все норм ,запускаю в му (а эт хоршо когда нету конекта а сразу открываетьсы окно где вписувать акк и пас?) вписую тот акк что я создал оно мне пишыт что "Invalid akkaunt" подскажыте что это может быть?:
Помогите создать АКК
Страница: 1
Сообщений 1 страница 2 из 2
Поделиться22007-12-29 20:51:41
Ток что сталкнулся с этой проблеммой на сервере 1.04R+
Обошел эт дело создав регалку (файл index.php):
Код:
<style type="text/css"> <!-- body { background-color: #ededed; } .style1 { font-size: 11px; color: #000000; } .style2 { font-size: 11px; font-weight: bold; color: #333333; } --> </style> <head> <title>Регистрация MuOnline на сервере 192.168.12.32</title> </head> <?php require ("config.php"); include_once("includes/functions.php"); require_once "sql_inject.php"; include_once('sql_check.php'); if (isset($_POST["registration"])) { echo '<p><span class="style111"><strong>Результат регистрации</strong></span><p>'; if ((isset($_COOKIE['pass'])) && (isset($_COOKIE['user']))); { $account = stripslashes($_POST['account']); $password = stripslashes($_POST['password']); $repassword = stripslashes($_POST['repassword']); $email = $_POST['email']; $idcode = $_POST['idcode']; $squestion = stripslashes($_POST['question']); $sanswer = stripslashes($_POST['answer']); $verifyinput = stripslashes($_POST['verifyinput']); $verifyinput2 = stripslashes($_POST['verifyinput2']); $account = clean_var($account); $password = clean_var($password); $repassword = clean_var($repassword); $email = clean_var($email); $idcode = clean_var($idcode); $squestion = clean_var($squestion); $sanswer = clean_var($sanswer); $verifyinput = clean_var($verifyinput); $verifyinput2 = clean_var($verifyinput2); check_inject(); $bDestroy_session = TRUE; $url_redirect = 'index.php'; $sqlinject = new sql_inject('./log_file_sql.log',$bDestroy_session,$url_redirect) ; $username_check = mssql_query("SELECT memb___id FROM MEMB_INFO WHERE memb___id='$account'"); $username_verify = mssql_num_rows($username_check); $email_check = mssql_query("SELECT mail_addr FROM MEMB_INFO WHERE mail_addr='$email'"); $email_verify = mssql_num_rows($email_check); if ( empty($account) || empty($password) || empty($repassword) || empty($email) || empty($squestion) || empty($sanswer) || empty($verifyinput2) ||empty($idcode)){echo "<img src=./images/warning.gif> Ошибка: не все поля заполнены!";} elseif (ereg('[^0-9]', $idcode)){echo "<img src=./images/warning.gif> Ошибка: в ид коде должны быть только цифры "; } elseif ($username_verify > 0){echo "<img src=./images/warning.gif> Ошибка: такой логин уже существует "; } elseif ($email_verify > 0){echo "<img src=./images/warning.gif> Ошибка: E-mail уже используется "; } elseif (($password != $repassword) || ($repassword != $password)){echo "<img src=./images/warning.gif> Ошибка: ваши коды не совпадают. "; } elseif ($verifyinput != $verifyinput2){echo "<img src=./images/warning.gif> Ошибка: вернитесь и повторно введите проверочный код."; } else { $msquery1 = "SET IDENTITY_INSERT MEMB_INFO ON"; $msquery2 = "INSERT INTO MEMB_INFO (memb___id,memb__pwd,memb_name,sno__numb,mail_addr,appl_days,modi_days,out__days,true_days,mail_chek,bloc_code,ctl1_code,fpas_ques,fpas_answ) VALUES ('$account','$password','gogame','$idcode','$email','01/01/2006','01/01/2006','01/01/2006','01/01/2006','1','0','0','$squestion','$sanswer')"; $msquery3 = "INSERT INTO VI_CURR_INFO (ends_days,chek_code,used_time,memb___id,memb_name,memb_guid,sno__numb,Bill_Section,Bill_value,Bill_Hour,Surplus_Point,Surplus_Minute,Increase_Days ) VALUES ('2005','1',1234,'$account','zzz',1,'7','6','3','6','6','2003-11-23 10:36:00','0')"; $sqlinject->test($msquery1); $sqlinject->test($msquery2); $sqlinject->test($msquery3); //$msresults= mssql_query($msquery1); $msresults= mssql_query($msquery2); $msresults= mssql_query($msquery3); echo "<img src=./images/ok.gif>Аккаунт создан удачно"; }} } else { ?> <form action="index.php" method="post" name="register" id="register"> <table width="47%" border="0" align="center"> <tr> <td width="16%" class="style2"> Login: </td> <td width="84%" class="style1"><input name="account" type="text" class="style" id="account" size="20" maxlength="10"></td> </tr> <tr> <td class="style2"> E-mail: </td> <td class="style1"><input name="email" type="text" class="style" id="email" size="20" maxlength="50"></td> </tr> <tr> <td class="style2">Password:</td> <td class="style1"><input name="password" type="password" class="style" id="password" size="15" maxlength="10"></td> </tr> <tr> <td class="style2">RePassword:</td> <td class="style1"><input name="repassword" type="password" class="style" id="repassword" size="15" maxlength="10"></td> </tr> <tr> <td class="style2">ID code: </td> <td class="style1"><input name="idcode" type="text" class="style" id="idcode" size="15" maxlength="7"> (введите 7 цифр)</td> </tr> <tr> <td colspan="2" class="style1"><p><br> Для востановления пароля</p> </td> </tr> <tr> <td class="style2">Вопрос:</td> <td class="style1"><input name="question" type="text" class="style" id="question" size="15" maxlength="10"></td> </tr> <tr> <td class="style2">Ответ:</td> <td class="style1"><input name="answer" type="text" class="style" id="answer" size="15" maxlength="10"></td> </tr> <tr> <td colspan="2" class="style1"><p><br> Защита от ботов </p> </td> </tr> <tr> <td class="style2"> </td> <td class="style1"> <?php require 'config.php'; print("$verify"); ?> <input name="verifyinput" type="hidden" id="verifyinput" value="<?PHP print("$verify"); ?>"></td> </tr> <tr> <td class="style2">Код:</td> <td class="style1"><input name="verifyinput2" type="text" class="style" id="verifyinput2" size="8" maxlength="10"></td> </tr> <tr> <td class="style1"><input name="registration" type="hidden" id="registration" value="registration"></td> </tr> </table> <table width="200" border="0" align="center" cellpadding="0" cellspacing="5"> <tr> <td><div align="right"><a href="#"><img src="./images/button_login.gif" width="49" height="16" border="0" onclick="if((register.account.value.length==0 || register.email.value.length==0 || register.password.value.length==0 || register.repassword.value.length==0 || register.question.value.length==0 || register.answer.value.length==0 )) alert('Не все поля заполнены!'); if ((register.account.value.length<4 || register.email.value.length<4 || register.password.value.length<4 || register.repassword.value.length<4 || register.question.value.length<4 || register.answer.value.length<4)) alert('Значения не должны быть меньше 4 символов!'); if (register.account.value.length>3 && register.email.value.length>3 && register.password.value.length>3 && register.repassword.value.length>3 && register.question.value.length>3 && register.answer.value.length>3){ register.submit()}; "></a></div></td> <td><a href="#"><img src="./images/button_cancel.gif" width="49" height="16" border="0" onclick='register.reset();'></a></td> </tr> </table> </form> <? } ?>
Файл config.php:
Код:
<? //error_reporting(E_ALL ^E_NOTICE ^E_WARNING); $msconnect=mssql_connect("127.0.0.1","sa","152958"); $msdb=mssql_select_db("MuOnline", $msconnect); $verify = (rand()%9999); ?>
Файл sql_check.php:
Код:
<?php // Anti-SQL Injection function check_inject() { $badchars = array(";","'","*","/"," \ ","DROP", "SELECT", "UPDATE", "DELETE", "drop", "select", "update", "delete", "WHERE", "where", "-1", "-2", "-3","-4", "-5", "-6", "-7", "-8", "-9","%","^","&","-","]","[","="); foreach($_POST as $value) { $value = clean_variable($value); if(in_array($value, $badchars)) { die("На странице произошла ошибка. Ваши данные сохранены и будут проанализированы администратором!\n<br />\nIP: ".$_SERVER['REMOTE_ADDR']); } else { $check = preg_split("//", $value, -1, PREG_SPLIT_OFFSET_CAPTURE); foreach($check as $char) { if(in_array($char, $badchars)) { die("На странице произошла ошибка. Ваши данные сохранены и будут проанализированы администратором!\n<br />\nIP: ".$_SERVER['REMOTE_ADDR']); } } } } } function clean_variable($var) { $newvar = preg_replace('/[^a-zA-Z0-9\_\-]/', '', $var); return $newvar; } ?>
Файл sql_inject.php:
Код:
<?PHP class sql_inject { /** * @shortdesc url to redirect if an sql inject attempt is detect. if unset, value is FALSE * @private * @type mixed */ var $urlRedirect; /** * @shortdesc does the session must be destroy if an attempt is detect * @private * @type bool */ var $bdestroy_session; /** * @shortdesc the SQL data currently test * @private * @type string */ var $rq; /** * @shortdesc if not FALSE, the url to the log file * @private * @type mixed */ var $bLog; /** * Builder * * @param bool bdestroy_session optional. does the session must be destroy if an attempt is detect? * @param string urlRedirect optional. url to redirect if an sql inject attempt is detect * @public * @type void */ function sql_inject($mLog=FALSE,$bdestroy_session=FALSE,$urlRedirect=FALSE) { $this->bLog = (($mLog!=FALSE)?$mLog:''); $this->urlRedirect = (((trim($urlRedirect)!='') && file_exists($urlRedirect))?$urlRedirect:''); $this->bdestroy_session = $bdestroy_session; $this->rq = ''; } /** * @shortdesc test if there is a sql inject attempt detect * test if there is a sql inject attempt detect * * @param string sRQ required. SQL Data to test * @public * @type bool */ function test($sRQ) { $sRQ = strtolower($sRQ); $this->rq = $sRQ; $aValues = array(); $aTemp = array(); // temp array $aWords = array(); // $aSep = array(' and ',' or '); // separators for detect the $sConditions = '('; $matches = array(); $sSep = ''; // is there an attempt to unused part of the rq? if (is_int((strpos($sRQ,"#")))&&$this->_in_post('#')) return $this->detect(); // is there a attempt to do a 2nd SQL requete ? if (is_int(strpos($sRQ,';'))){ $aTemp = explode(';',$sRQ); if ($this->_in_post($aTemp[1])) return $this->detect(); } $aTemp = explode(" where ",$sRQ); if (count($aTemp)==1) return FALSE; $sConditions = $aTemp[1]; $aWords = explode(" ",$sConditions); if(strcasecmp($aWords[0],'select')!=0) $aSep[] = ','; $sSep = '('.implode('|',$aSep).')'; $aValues = preg_split($sSep,$sConditions,-1, PREG_SPLIT_NO_EMPTY); // test the always true expressions foreach($aValues as $i => $v) { // SQL injection like 1=1 or a=a or 'za'='za' if (is_int(strpos($v,'='))) { $aTemp = explode('=',$v); if (trim($aTemp[0])==trim($aTemp[1])) return $this->detect(); } //SQL injection like 1<>2 if (is_int(strpos($v,'<>'))) { $aTemp = explode('<>',$v); if ((trim($aTemp[0])!=trim($aTemp[1]))&& ($this->_in_post('<>'))) return $this->detect(); } } if (strpos($sConditions,' null')) { if (preg_match("/null +is +null/",$sConditions)) return $this->detect(); if (preg_match("/is +not +null/",$sConditions,$matches)) { foreach($matches as $i => $v) { if ($this->_in_post($v))return $this->detect(); } } } if (preg_match("/[a-z0-9]+ +between +[a-z0-9]+ +and +[a-z0-9]+/",$sConditions,$matches)) { $Temp = explode(' between ',$matches[0]); $Evaluate = $Temp[0]; $Temp = explode(' and ',$Temp[1]); if ((strcasecmp($Evaluate,$Temp[0])>0) && (strcasecmp($Evaluate,$Temp[1])<0) && $this->_in_post($matches[0])) return $this->detect(); } return FALSE; } function _in_post($value) { foreach($_POST as $i => $v) { if (is_int(strpos(strtolower($v),$value))) return TRUE; } return FALSE; } function detect() { // log the attempt to sql inject? if ($this->bLog) { $fp = @fopen($this->bLog,'a+'); if ($fp) { fputs($fp,"\r\n".date("d-m-Y H:i:s").' ['.$this->rq.'] from '.$this->sIp = getenv("REMOTE_ADDR")); fclose($fp); } } // destroy session? if ($this->bdestroy_session) session_destroy(); // redirect? if ($this->urlRedirect!=''){ if (!headers_sent()) header("location: $this->urlRedirect"); } return TRUE; } function protect1($protected) { // This Will be the fuction we call to protect the variables. $banlist = array ("'", "\"", "<", "\\", "|", "/", "=", "insert", "select", "update", "delete", "distinct", "having", "truncate", "replace", "handler", "like", "procedure", "limit", "order by", "group by", "asc", "desc"); //$banlist is the list of words you dont want to allow. if ( eregi ( "[a-zA-Z0-9@]+", $protected ) ) { // Makes sure only legitimate Characters are used. $protected = trim(str_replace($banlist, '', $protected)); // Takes out whitespace, and removes any banned words. return $protected; //echo "+"; } else { //echo "-"; echo $protected; die ( ' Is invalid for that spot, please try a different entry.' ); // Message if thier is any characters not in [a-zA-Z0-9]. } // ends the if ( eregi ( "[a-zA-Z0-9]+", $this->protected ) ) { } // ends the function Protect() { function protect2($protected) { // This Will be the fuction we call to protect the variables. $banlist = array ("'", "\"", "<", "\\", "|", "/", "=", "insert", "select", "update", "delete", "distinct", "having", "truncate", "replace", "handler", "like", "procedure", "limit", "order by", "group by", "asc", "desc"); //$banlist is the list of words you dont want to allow. if ( eregi ( "[0-9]+", $protected ) ) { // Makes sure only legitimate Characters are used. $protected = trim(str_replace($banlist, '', $protected)); // Takes out whitespace, and removes any banned words. return $protected; //echo "+"; } else { //echo "-"; echo $protected; die ( ' Is invalid for that spot, please try a different entry.' ); // Message if thier is any characters not in [a-zA-Z0-9]. } // ends the if ( eregi ( "[a-zA-Z0-9]+", $this->protected ) ) { } // ends the function Protect() { } ?>
Файл includes/functions.php:
Код:
<?php if (eregi("includes/functions.php", $_SERVER['SCRIPT_NAME'])) { die ("Access Denied!"); } function clean_var($var=NULL) { $newvar = @preg_replace('/[^a-zA-Z0-9\_\-\.]/', '', $var); if (@preg_match('/[^a-zA-Z0-9\_\-\.]/', $var)) { } return $newvar; } ?>
Извиняюсь что выложил просто код, а не файлы, но мне так удобнее
Страница: 1