如何在PHP中进行身份认证
来源:互联网 发布:人类知乎 编辑:程序博客网 时间:2024/05/17 07:15
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
if(!isset($PHP_AUTH_USER))
{
Header("WWW-Authenticate: Basic realm=请输入你的用户名和密码:");
Header("HTTP/1.0 401 Unauthorized");
echo "验证失败,你不能网络资源!";
exit;
}
else
{
if ($PHP_AUTH_USER!="username" or $PHP_AUTH_PW!="password")
{
Header("HTTP/1.0 401 Unauthorized");
echo "验证失败,你不能网络资源!";
exit;
}
}
?>
转自:动态网制作指南 www.knowsky.com<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<? if(!isset($PHP_AUTH_USER))
{
Header("WWW-Authenticate: Basic realm=请输入你的用户名和密码:");
Header("HTTP/1.0 401 Unauthorized");
echo "验证失败,你不能网络资源!";
exit;
}
else
{
if ($PHP_AUTH_USER!="username" or $PHP_AUTH_PW!="password")
{
Header("HTTP/1.0 401 Unauthorized");
echo "验证失败,你不能网络资源!";
exit;
}
}
?>
转自:动态网制作指南 www.knowsky.com<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
- 如何在PHP中进行身份认证
- 如何在PHP中进行身份认证
- 使用PHP进行用户身份认证
- 在Azure平台上使用托管卡进行身份认证
- 在Azure平台上使用托管卡进行身份认证
- C#.Net中WinForm采用Active Directory进行身份认证
- C#中WinForm采用Active Directory进行身份认证
- tomcat进行管理员身份认证
- PHP中用户身份认证实现二法
- PHP中用户身份认证实现二法(2)
- PHP中用户身份认证实现二法(1)
- PHP的HTTP身份认证
- 在ASP编程中,身份认证的作用
- 使用Apache Shiro进行身份认证
- [ZT]使用 PAM 进行身份认证
- express,使用session进行身份认证
- 如何使用OPENSSL中的RSA和AES模块进行身份认证和业务加解密
- flash++json+php+MySQL身份认证系统
- 在ASP.NET中处理 datetime 的一些通用函数(vb)
- 一个改进的UBB类
- .Net 的一年
- 复杂检索数据并分页显示的处理方法
- 用ASP.NET动态生成图像(转1)
- 如何在PHP中进行身份认证
- .Net开放源码工程之二---正则表达式函数库
- PHP+APACHE实现用户论证的方法
- 用C#访问Access数据库
- vBulletin HACK----关于排版的两个HACK
- 使用 ADO.NET 解锁 Microsoft Access 数据(2)
- 利用递归把多维数组转为一维数组的函数
- 今日读 asp.net 心得 ---- 比较意识流,神经衰弱勿进
- vBulletin HACK----显示话题大小和打开新窗口于论坛索引页