รบกวนช่วยดู Code นี้หน่อยครับถ้าจะเขียนให้ดึงค่าจาก mysql ต้องแก้ตรงไหนบ้าง ขอคำแนะนำด้วยครับ ขอบคุณมากครับ
**********
<?PHP
// include this file where you want to limit access.
$username = "test";
$password = "123";
function authenticate() {
Header( "WWW-authenticate: basic realm='Protected'");
Header( "HTTP/1.0 401 Unauthorized");
echo "You must enter a valid login ID and password! ";
exit;
}
function CheckPwd($user,$pass) {
global $username,$password;
return ($user != $username || $pass != $password) ? false : true;
}