我用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();
?>
你试试能不能连上,如果一直不动会不会你的异常没有写好,看看这两个本回答被提问者和网友采纳
alert是警告