在写代码的时候遇到的问题,问ls了也已读不回
关联代码没有任何问题,只有点击注册时跳转页面有问题
以下是关联代码
<?php
include_once "header.php"
?>
<style type="text/css">
.tb{
text-align: center;
width: 400px;
border: 1px darksalmon solid;
background-color: rgba(255, 182, 193, 0.8);
border-collapse: collapse;
}
tr{
border: 1px #00c4ff solid;
}
td{
border: 1px #ff5900 solid;
}
</style>
<form action="logincheck.php" method="post">
<table class="tb" align="center">
<tr>
<td colspan="2">会员登录</td>
</tr>
<tr>
<td>用户名</td>
<td>
<input type="text" name="username">
</td>
</tr>
<tr>
<td>密码</td>
<td>
<input type="password" name="password">
</td>
</tr>
<tr>
<td>确认密码</td>
<td>
<input type="password" name="okpassword" >
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="button" value="注册" onclick="window.location.href='registercheck.php'">
</td>
</tr>
</table>
</form>
<?php
?>
<?php
include_once "footer.php"
?>
点击注册后显示空白界面
<?php
//获取用户提交的注册信息
$username=$_POST["username"];
$psw=$_POST["password"];
$psw1=$_POST["password1"];
if(strcmp($psw,$psw1)==0)
{
$link=@mysqli_connect("127.0.0.1","root","root","student2001","3306");
//var_dump($link);
if($link==false){
die("数据库连接失败!".mysqli_connect_error());
}
//执行查找语句,查找表中有没有此用户
$sql=<<<LM
select * from users where username="$username"
LM;
$query=mysqli_query($link,$sql);
if(mysqli_num_rows($query)>0)
{
echo "<script>alert('你输入的用户已存在,请继续输入')</script>";
header("refresh:1;url=register.php");
}
else
{
//把输入的用户信息插入到数据库表中
$sql1=<<<LM
insert into users (username,password) values("$username","$psw")
LM;
$query=mysqli_query($link,$sql1);
if($query==true)
{
echo "<script>alert('用户注册成功,请登录')</script>";
header("refresh:1;url=login.php");
}
}
}
else
{
echo "<script>alert('两次密码不相同,请继续输入')</script>";
header("refresh:1;url=register.php");
}
求各位指点迷津/(ㄒoㄒ)/~~