大家帮我看看这个php语句有什么问题
我在做一个网站,现在要判断用户登录:1.log.php:
<form method="post" target="_blank" action="refreshindex.php">
用户名:<input type="text" name="username" width="10" /><br /><br />
密 码:<input type="password" name="password" width="10" /><br /><br />
<input type="submit" size="20" value="登录" onclick="window.location.assign('logindex.php')" />
</form>
2:logindex
<?php
if($_POST['username']!=" "&&$_POST['password']!=" ")
{
$conn=new mysqli("localhost","root","910523","classweb");
$conn->query('set sql_mode=""');
$conn->query('set names utf8');
$username=$_POST['username'];
$password=$_POST['password'];
if($conn->query("call pro_reges2('$username','$password')"))
{
echo "<script>alert('用户登录成功');</script>";
}
else
{
echo "<script>alert('用户登录失败');</script>";
}
}
?>
3数据库储存过程:
delimiter //
create procedure pro_reges2(in username varchar(50),
in password varchar(50))
begin
select * from user where userno=username and pwd=password;
end;
//