authenticate.inc
来自「《SQL Server 2000课程设计案例精编》-李昆-源代码-3436」· INC 代码 · 共 17 行
INC
17 行
<?php
//---------------------------
// 用户认证函数 auth.inc
// Author: Wilson Peng
// Copyright (C) 1999
//---------------------------
$handle=fopen("./include/passwd.txt","r");
$auth=fgets($handle);
$temp=explode(":",$auth);
if(!(isset($_SERVER["PHP_AUTH_USER"])&&($_SERVER["PHP_AUTH_USER"]==$temp[0]&&$_SERVER["PHP_AUTH_PW"]==$temp[1]))) {
header('WWW-Authenticate: Basic realm="Power User"');
header("HTTP/1.0 401 Anauthorized");
echo "请和管理员联系";
exit;
}
?>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?