php注册页面验证码,不知道哪儿有异常,每次提交就算验证码打错了,居然也能成功提交
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了php注册页面验证码,不知道哪儿有异常,每次提交就算验证码打错了,居然也能成功提交,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2356字,纯文字阅读大概需要4分钟。
内容图文
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));
}
?>
内容总结
以上是互联网集市为您收集整理的php注册页面验证码,不知道哪儿有异常,每次提交就算验证码打错了,居然也能成功提交全部内容,希望文章能够帮你解决php注册页面验证码,不知道哪儿有异常,每次提交就算验证码打错了,居然也能成功提交所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。