php注册页面代码 验证码,php注册页面验证码,不知道哪儿有异常,每次提交就算验证码打错了,居然也能成功提交...

当前位置:我的异常网» PHP » php注册页面验证码,不知道哪儿有异常,每次提交就

php注册页面验证码,不知道哪儿有异常,每次提交就算验证码打错了,居然也能成功提交

www.myexceptions.net  网友分享于:2013-03-23  浏览:27次

php注册页面验证码,不知道哪儿有错误,每次提交就算验证码打错了,居然也能成功提交。

以下是注册页面的全部代码,每次提交验证码不管是输入正确还是错误,内容都会被成功提交。求解决大家看看代码哪儿有错误。

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);

$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));

}

?>

用户注册
会员账号注册
*用户名

文章评论

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值