解决下javascript无限弹窗的问题
//注册跳转function_location($_info,$_url){echo"<scripttype='text/javascript'>alert('$_inf...
//注册跳转
function _location($_info,$_url){
echo "<script type='text/javascript'>alert('$_info');location.href='$_url';</script>";
exit();
}
注册的 页面一打开 就会 弹窗 没完没了 如何解决
以下是相关代码
<?php
session_start();
define('IN_TG',true);
define(SCRIPT,'register');
require dirname(__FINE__).'/include/common.inc.php';
if($_GET['action']=='register'){
//验证码
if($_POST['code']!=$_SESSION['code']){
_back_alert('验证码错误');
}
include ROOT_PATH.'/include/reg.func.php';
//创建表单数组
$_clean=array();
$_clean['uniqid'] = _cheke_uniqid($_POST['uniqid'],$_SESSION['uniqid']);
$_clean['active'] = $_SESSION['uniqid'];
$_clean['username'] = _check_uesrname($_POST['username']);
$_clean['password'] = _check_password($_POST['password'],$_POST['notpassword']);
$_clean['sex'] = _check_sex($_POST['sex']);
$_clean['face'] = _check_face($_POST['face']);
$_clean['question'] = _check_que($_POST['question']);
$_clean['answer'] = _check_ans($_POST['question'], $_POST['answer']);
$_clean['email'] = _check_email($_POST['email']);
$_clean['qq'] = _check_qq($_POST['qq']);
$_clean['url'] = _check_url($_POST['url']);
foreach($_clean as $key => $value){
echo $key."==>".$value.'<br>';
}
//新增数据
mysql_query(
"INSERT INTO tg_user(
tg_uniqid,
tg_active,
tg_username,
tg_password,
tg_sex,
tg_face,
tg_question,
tg_answer,
tg_email,
tg_qq,
tg_url,
tg_reg_time,
tg_last_time,
tg_last_ip
)
VALUES
(
'{$_clean['uniqid']}',
'{$_clean['active']}',
'{$_clean['username']}',
'{$_clean['password']}',
'{$_clean['sex']}',
'{$_clean['face']}',
'{$_clean['question']}',
'{$_clean['answer']}',
'{$_clean['email']}',
'{$_clean['qq']}',
'{$_clean['url']}',
NOW(),
NOW(),
'{$_SERVER["REMOTE_ADDR"]}'
)"
)or die('数据库错误');
}else{ //标识符
$_SESSION['uniqid'] = $_uniqid=sha1(uniqid(rand(),true));
}
mysql_close();
_location('恭喜您注册成功', 'index.php');
?> 展开
function _location($_info,$_url){
echo "<script type='text/javascript'>alert('$_info');location.href='$_url';</script>";
exit();
}
注册的 页面一打开 就会 弹窗 没完没了 如何解决
以下是相关代码
<?php
session_start();
define('IN_TG',true);
define(SCRIPT,'register');
require dirname(__FINE__).'/include/common.inc.php';
if($_GET['action']=='register'){
//验证码
if($_POST['code']!=$_SESSION['code']){
_back_alert('验证码错误');
}
include ROOT_PATH.'/include/reg.func.php';
//创建表单数组
$_clean=array();
$_clean['uniqid'] = _cheke_uniqid($_POST['uniqid'],$_SESSION['uniqid']);
$_clean['active'] = $_SESSION['uniqid'];
$_clean['username'] = _check_uesrname($_POST['username']);
$_clean['password'] = _check_password($_POST['password'],$_POST['notpassword']);
$_clean['sex'] = _check_sex($_POST['sex']);
$_clean['face'] = _check_face($_POST['face']);
$_clean['question'] = _check_que($_POST['question']);
$_clean['answer'] = _check_ans($_POST['question'], $_POST['answer']);
$_clean['email'] = _check_email($_POST['email']);
$_clean['qq'] = _check_qq($_POST['qq']);
$_clean['url'] = _check_url($_POST['url']);
foreach($_clean as $key => $value){
echo $key."==>".$value.'<br>';
}
//新增数据
mysql_query(
"INSERT INTO tg_user(
tg_uniqid,
tg_active,
tg_username,
tg_password,
tg_sex,
tg_face,
tg_question,
tg_answer,
tg_email,
tg_qq,
tg_url,
tg_reg_time,
tg_last_time,
tg_last_ip
)
VALUES
(
'{$_clean['uniqid']}',
'{$_clean['active']}',
'{$_clean['username']}',
'{$_clean['password']}',
'{$_clean['sex']}',
'{$_clean['face']}',
'{$_clean['question']}',
'{$_clean['answer']}',
'{$_clean['email']}',
'{$_clean['qq']}',
'{$_clean['url']}',
NOW(),
NOW(),
'{$_SERVER["REMOTE_ADDR"]}'
)"
)or die('数据库错误');
}else{ //标识符
$_SESSION['uniqid'] = $_uniqid=sha1(uniqid(rand(),true));
}
mysql_close();
_location('恭喜您注册成功', 'index.php');
?> 展开
若以下回答无法解决问题,邀请你更新回答
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询