你帮我看看嘛
<?
if (isset($php_auth_user))
{
header("WWW-Authenticate: Basic realm=\"身份验证功能\"");
header("http/1.0 401 Unauthorized");
echo "登陆失败";
exit;
}
else {
$link=mysql_connect("127.0.0.1","root","");
$db=mysql_select_db("test");
$sql="select * from test where name='$php_auth_user' and pass='$php_auth_pw'";
$result=mysql_query($sql);
if ($myrow = mysql_fetch_array($result))
header("location:http://www.stuhome.net");
}
?>
<?
if (isset($php_auth_user))
{
header("WWW-Authenticate: Basic realm=\"身份验证功能\"");
header("http/1.0 401 Unauthorized");
echo "登陆失败";
exit;
}
else {
$link=mysql_connect("127.0.0.1","root","");
$db=mysql_select_db("test");
$sql="select * from test where name='$php_auth_user' and pass='$php_auth_pw'";
$result=mysql_query($sql);
if ($myrow = mysql_fetch_array($result))
header("location:http://www.stuhome.net");
}
?>
$result=mysql_query($sql);改成$result=mysql_query($sql,$link);try
2、$sql="select * from test where name='${php_auth_user}' and pass='${php_auth_pw}'";
太faint了