|
|
|
|
![]() ![]() |
Oct 8 2007, 08:23 PM
Post
#1
|
|
|
Newbie [Level 2] ![]() ![]() Group: Validating Posts: 25 Joined: 8-October 07 Member No.: 51,330 |
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.
CODE <?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 you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.<P> <P>Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. <HR> <ADDRESS>Apache/1.3.37 Server at www.darkzone3.110mb.com 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> |
|
|
|
Oct 8 2007, 08:49 PM
Post
#2
|
|
|
A computer once beat me at chess, but it was no match for me at kick boxing. ![]() Group: [MODERATOR] Posts: 3,882 Joined: 24-July 05 From: In Trouble Again... still? Member No.: 9,787 ![]() |
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... |
|
|
|
Oct 10 2007, 01:00 PM
Post
#3
|
|
|
Advanced Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 137 Joined: 20-March 07 From: Where ever you want me to be Member No.: 40,391 |
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
|
|
|
|
![]() ![]() |
Similar Topics
| Topics | Topics | |
|---|---|---|
|
|
|
|
Lo-Fi Version | Time is now: 25th July 2008 - 08:04 PM |