你帮我看看嘛
<?
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");
}
?>
解决方案 »
- 如何判断某字符串是否为一个合法的邮箱地址
- PHP数组 谢谢 超级菜菜问题
- 关于给图片加水印
- PHP中使用DOM方法如何根据XML子节点值或子节点属性删除所在的父节点?
- 如何使用mcrypt库?????
- smarttemplate的缓存使用问题
- 取得页面自身文件名的常量(或变量)是什么? 在线等待~~~~
- [求助]在xp下配置php,为什么告诉我找不到指定模块?解决马上给20分!
- 各位请进,这样的查询在mysql里怎么写
- php编程 连接数据库 读取数据表的问题
- 这个规则该怎么写?[^\"'>string]也就是说,不具有"'>的任何一个,同时不具有string这个字串。
- 怎样使一个网页必须在指定的框架内显示,而不能直接在地址栏直接访问?
$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了