我用PHP+MYSQL语言,用户登录和注册后并没有跳转到指向页面,而是一直停留在check的那个页面

我用PHP+MYSQL语言,用户登录和注册后并没有跳转到指向页面,而是一直停留在check的那个页面,既没有提示成功也没提示失败,我再返回可是页面确实显示的是已经登录了
chkuser.php
<?php
error_reporting(0);
include("conn/conn.php");
$username=$_POST[username];
$userpwd=md5($_POST[userpwd]);
$yz=$_POST[yz];
$num=$_POST[num];
if(strval($yz)!=strval($num)){
echo "<script>alert('验证码输入错误!');history.go(-1);</script>";
exit;
}
class chkinput{
var $name;
var $pwd;

function chkinput($x,$y){
$this->name=$x;
$this->pwd=$y;
}

function checkinput(){
include("conn/conn.php");
$sql=mysql_query("select * from tb_user where name='".$this->name."'",$conn);
$info=mysql_fetch_array($sql);
if($info==false){
echo "<script language='javascript'>alert('不存在此用户!');history.back

();</script>";
exit;
}
else{
if($info[dongjie]==1){
echo "<script language='javascript'>alert('该用户已经被冻

结!');history.back();</script>";
exit;
}

if($info[pwd]==$this->pwd)
{
session_start();
$_SESSION[username]=$info[name];
session_register("producelist");
$producelist="";
session_register("quatity");
$quatity="";
header("location:index.php");
exit;
}
else {
echo "<script language='javascript'>alert('密码输入错误!');history.back

();</script>";
exit;
}

}
}
}

$obj=new chkinput(trim($username),trim($userpwd));
$obj->checkinput();
?>

第1个回答  2015-11-27
你确定你连接到mysql了么?
你试试能不能连上,如果一直不动会不会你的异常没有写好,看看这两个本回答被提问者和网友采纳
第2个回答  2015-11-24
alter会终止程序追问

alert是警告

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网