Php registration page verification code, do not know where there is an error, each submission even if the verification code is wrong, it can be successfully submitted. The following are all the codes on the registration page. the content of each verification code submitted, whether entered correctly or incorrectly, will be successfully submitted. Please let us know where the code is wrong. & Lt ;? Phprequire_once (Connectionsconn. php );? & Gt; & lt ;? Phpsession_start ();? & Php registration page verification code, do not know where there is an error, each submission even if the verification code is wrong, it can be successfully submitted.
The following are all the codes on the registration page. the content of each verification code submitted, whether entered correctly or incorrectly, will be successfully submitted. Please let us know where the code is wrong.
If (! Function_exists ("GetSQLValueString ")){
Function GetSQLValueString ($ theValue, $ theType, $ theDefinedValue = "", $ theNotDefinedValue = "")
{
If (PHP_VERSION <6 ){
$ TheValue = get_magic_quotes_gpc ()? Stripslashes ($ theValue): $ theValue;
}
$ TheValue = function_exists ("mysql_real_escape_string ")? Mysql_real_escape_string ($ theValue): mysql_escape_string ($ theValue );
Switch ($ theType ){
Case "text ":
$ TheValue = ($ theValue! = "")? "'". $ TheValue. "'": "NULL ";
Break;
Case "long ":
Case "int ":
$ TheValue = ($ theValue! = "")? Intval ($ theValue): "NULL ";
Break;
Case "double ":
$ TheValue = ($ theValue! = "")? Doubleval ($ theValue): "NULL ";
Break;
Case "date ":
$ TheValue = ($ theValue! = "")? "'". $ TheValue. "'": "NULL ";
Break;
Case "defined ":
$ TheValue = ($ theValue! = "")? $ TheDefinedValue: $ theNotDefinedValue;
Break;
}
Return $ theValue;
}
}
$ EditFormAction = $ _ SERVER ['php _ SELF '];
If (isset ($ _ SERVER ['query _ string']) {
$ EditFormAction. = "? ". Htmlentities ($ _ SERVER ['query _ string']);
}
If (isset ($ _ POST ["MM_insert"]) & ($ _ POST ["MM_insert"] = "form1 ")){
$ InsertSQL = sprintf ("insert into user_zc (username, pass, phonenumber, realname, sex) VALUES (% s, % s )",
GetSQLValueString ($ _ POST ['username'], "text "),
GetSQLValueString ($ _ POST ['pass'], "text "),
GetSQLValueString ($ _ POST ['phonenumber'], "int "),
GetSQLValueString ($ _ POST ['realname'], "text "),
GetSQLValueString ($ _ POST ['select'], "text "));
If ($ _ POST ['yzm']! ==$ _ SESSION ["vocode"]) {
Header ("location:". "user_zcsb.php ");
}
Mysql_select_db ($ database_conn, $ conn );
$ Result1 = mysql_query ($ insertSQL, $ conn) or die (mysql_error ());
$ InsertGoTo = "user_zccg.php ";
If (isset ($ _ SERVER ['query _ string']) {
$ InsertGoTo. = (strpos ($ insertGoTo ,'? '))? "&":"? ";
$ InsertGoTo. = $ _ SERVER ['query _ string'];
}
Header (sprintf ("Location: % s", $ insertGoTo ));
}
?>
User registration
Member account registration |
* User name |