auth.inc

来自「PHP解释器」· INC 代码 · 共 24 行

INC
24
字号
<?    cfunction authenticate() {        Header("WWW-authenticate: basic realm=\"Photo Album\"");        Header("HTTP/1.0 401 Unauthorized");        $title="Invalid Login";        include "include/header.inc";?>        In order to proceed you will need a valid username/password.        <?include "include/footer.inc";        exit;    }    if(!isset($PHP_AUTH_USER)) {        authenticate();    } else {        mysql_pconnect("localhost","nobody","") or die("Unable to connect to SQL server");        mysql_select_db("rasmus") or die("Unable to select database");        $id=strtolower($PHP_AUTH_USER);        $query = mysql_query("select * from users where id='$id' and password='$PHP_AUTH_PW'");        if(!mysql_num_rows($query)) {            authenticate();        }    }?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?