PHP registration page Verification Code, do not know where there is an exception, each submission even if the verification code wrong, can also be successfully submitted

Source: Internet
Author: User
PHP registration page Verification Code, do not know where there are errors, each submission even if the verification code wrong, incredibly can also successfully submitted.
The following is the registration page of all the code, each time the verification code submitted, whether the input is correct or error, the content will be successfully submitted. Find out 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,%s,%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);
$Result 1 = 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));
}
?>




<title>User Registration</title>









  • Member account Registration
    * User Name

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.