你用的PHP版本是多少。
4.1.0以后register global = off
这样取不到变量
取得变量用$_SERVER['PHP_AUTH_USER']和$_SERVER['PHP_AUTH_PW];
或者将php.ini中register global 设为 on
4.1.0以后register global = off
这样取不到变量
取得变量用$_SERVER['PHP_AUTH_USER']和$_SERVER['PHP_AUTH_PW];
或者将php.ini中register global 设为 on
解决方案 »
- 请问snoopy支持先用post的方式登陆网站,再用post的方式提交表格吗?
- 最近困惑,迷茫过,不知道自己是否还要继续,如果要继续还需要补充什么知识?
- 有段php看不明白
- 求用PHP将MySQL数据表转换为Excel表的方法!
- unexpected $end error why?
- 上传文件时得不到$upload,$upload_name....等变量!
- 我刚写了一个树状显示(递归),但老显示不对,哪位仁兄帮忙看一下,急~
- 请教PHP数组的传递
- 请问,如何用mail函数批量发送邮件.多谢.
- PHP里为啥会有session_start()这个函数?
- 提问:关于对xml文件的数据读取问题
- 分数不多,问题是关于xml的解析,有愿意帮我的,加我qq: 139800319
if(!isset($PHP_AUTH_USER))
{
header("WWW-Authenticate:Basic realm=\"访问权限验证\"");
header("HTTP/1.0 401 Unauthorized");
echo "<script>alert('请注册/登陆后购物!');top.location.href='index.php';</script>";
}
/*连接数据库*/
else
{
include('conn.php');
/*查询用户是否存在*/
$query1 = "select password,enable from access where username='$PHP_AUTH_USER' ";
$result = @mysql_query($query1);
if(!$result)
{
header("WWW-Authenticate:Basic realm=\"身份验证功能\"");
header("HTTP/1.0 401 Unauthorized");
echo "<script>alert('请注册/登陆后购物!');top.location.href='index.php';</script>";
}
else
{
$row = @mysql_fetch_array($result);
$password = $row[0];
$enable = $row[1];
if($enable==0)
{
header("WWW-Authenticate:Basic realm=\"身份验证功能\"");
header("HTTP/1.0 401 Unauthorized");
echo "<script>alert('请注册/登陆后购物!');top.location.href='index.php';</script>";
}
else if ($password!=$PHP_AUTH_PW)
{
header("WWW-Authenticate:Basic realm=\"身份验证功能\"");
header("HTTP/1.0 401 Unauthorized");
echo "<script>alert('请注册/登陆后购物!');top.location.href='index.php';</script>";
}
}
}
?>