PHP Http Basic Authentication
發表於 : 2013年 8月 2日, 10:42
http://docstore.mik.ua/orelly/webprog/pcook/ch08_10.htm
主要使用以下程式碼:
主要使用以下程式碼:
代碼: 選擇全部
header('WWW-Authenticate: Basic realm="My Website"');
header('HTTP/1.0 401 Unauthorized');
echo "You need to enter a valid username and password.";
exit;