PHP实现登录功能点击提交之后出现这个是哪里错误,代码如下:
<?phpif(isset($_POST['button'])){$usernaem=$_POST['username'];$password=$_POST['passw...
<?php
if(isset($_POST['button']))
{
$usernaem=$_POST['username'];
$password=$_POST['password'];
@mysql_connect('localhost','root','123456') or die(mysql_error());
mysql_query('set names utf8');
mysql_select_db('student') or die(mysql_error());
$sql="select * from `students` where xuehao='$password' and xm='$username'";
$rs=mysql_query($sql);
if(mysql_num_rows($rs)==1)
{
header('location:index.php');
}
else
{
echo "登陆失败";
}
}
?> 展开
if(isset($_POST['button']))
{
$usernaem=$_POST['username'];
$password=$_POST['password'];
@mysql_connect('localhost','root','123456') or die(mysql_error());
mysql_query('set names utf8');
mysql_select_db('student') or die(mysql_error());
$sql="select * from `students` where xuehao='$password' and xm='$username'";
$rs=mysql_query($sql);
if(mysql_num_rows($rs)==1)
{
header('location:index.php');
}
else
{
echo "登陆失败";
}
}
?> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询