iGuest 3 Report post Posted October 8, 2007 i need help finding out whats wrong with this code it just sends me to the error page when ever i enter the right login. <?php$user = 'william';$pass = 'password';function httpauth(){ header('WWW-Authenticate: Basic realm="Dark Zone Staff Login"'); header('HTTP/1.0 401 Unauthorized'); echo '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"><HTML><HEAD><TITLE>401 Authorization Required</TITLE></HEAD><BODY><H1>Authorization Required</H1>This server could not verify that youare authorized to access the documentrequested. Either you supplied the wrongcredentials (e.g., bad password), or yourbrowser doesn't understand how to supplythe credentials required.<P><P>Additionally, a 404 Not Founderror was encountered while trying to use an ErrorDocument to handle the request.<HR><ADDRESS>Apache/1.3.37 Server at http://110mb.com/404.php Port 80</ADDRESS></BODY></HTML>'; exit;}while($_SERVER['PHP_AUTH_USER'] != $user && $_SERVER['PHP_AUTH_PW'] != $pass){httpauth();}?><html><head><title>mypage</title></head><body><h1>PHP RULES</h1></body></html> Share this post Link to post Share on other sites
jlhaslip 4 Report post Posted October 8, 2007 It apparently thinks you have a bad user name or password.And that script is using HTML2.0, a couple of generations old. Probably not completely understood by today's Browsers, but then again, I yearn for the simpler times... Share this post Link to post Share on other sites
Ridwan sameer 0 Report post Posted October 10, 2007 Ah yeah it is using HTML 2.0 and it says the password was bad. For some reason. Does your bowser support HTML 2.0? If not try finding a different Security code they are scattered all over the web Share this post Link to post Share on other sites