PHP文件设置登录页面,一点击登录页面刷新无法跳转到下一页

<?php session_start();?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>用户注册</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<script language="javascript">
function chkinput(form){

if(form.admin_user.value==""){
alert("请输入用户昵称!");
form.admin_user.select();
return(false);
}
if(form.admin_pass.value==""){
alert("请输入注册密码!");
form.admin_pass.select();
return(false);
}
return(true);
}

</script>
<body>
<table width="800" height="600" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="middle"><table width="635" height="372" border="0" align="center" cellpadding="0" cellspacing="0" background="images/dl.jpg">
<form name="form1" method="post" action="index.php" onsubmit="return chkinput(this)">
<tr>
<td width="94" height="299"></td>
<td width="106"></td>
<td width="66"></td>
<td colspan="3"></td>
</tr>
<tr>
<td height="39"></td>
<td align="center"><input type="text" name="admin_user" class="inputcss" size="14"></td>
<td></td>
<td width="106" align="center"><input type="password" name="admin_pass" class="inputcss" size="14"></td>
<td width="96"><input type="image" name="imageField" src="images/dl_03.gif"></td>
<td width="167"><input type="image" name="reset" src="images/dl_04.gif" onClick="form.reset();return false;" class="inputcss" ></td>
</tr>
<tr>
<td height="34"></td>
<td></td>
<td></td>
<td colspan="3"></td>
</tr>
</form>
</table></td>
</tr>
</table>
<?php
if(isset($_POST['admin_user']) || isset($_POST['admin_pass'])){
$Connections=new mysqli("localhost","root","root","db_logistics");
$Connections->query("set names gb2312");
$admin_user=$_POST['admin_user'];
$admin_pass=md5($_POST['admin_pass']);
$sql=$Connections->query("call admin_reg('".$admin_user."','".$admin_pass."')");
$res=$sql->fetch_array(MYSQL_BOTH);
if($res!=NULL){

$_SESSION['admin_user']=$_POST['admin_user'];
$_SESSION['admin_pass']=md5($_POST['admin_pass']);
echo "<script>alert('管理员登录成功!');window.location.href='indexs.php';</script>";
}else{
echo "<script>alert('管理员登录失败!');</script>";

}
}
?>
</body>
</html>

查看下自己配置的重写规则,是不是所有域名下的访问都指向了index.php,导致网页跳转不成功。
温馨提示:答案为网友推荐,仅供参考

相关了解……

你可能感兴趣的内容

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