Can Some One Tell Me Whats Wrong With This

free web hosting
Open Discussion > CONTRIBUTE > Computers > Programming Languages > PHP Programming

Can Some One Tell Me Whats Wrong With This

Dark Zero
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>

 

 

 


Reply

jlhaslip
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...

Reply

Ridwan sameer
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

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.

Similar Topics

Keywords : whats, wrong

  1. Whats Wrong>?
    please see this piece of code and see whats wrong: (9)
  2. Php Include Root Ref
    whats the root? (6)
    Every one knows that we can include files in our site, so we have a folder with 2 files, an
    index.php with a menu.php included. But they are on the same folder, what if we wanted to make a
    relative reference for it, so we will always put include("/files/menu.php") and it will always work
    wherever that file is (the file calling the include). Ive had troubles with this, as it doesnt seem
    to be working, i have to change to the dot notation (like ../../../../../files/menu.php) in order to
    keep my includes right. Does any one know what the root is for the include or how can ....
  3. Whats The Beg Thing About Php?
    help (7)
    um, I'm just now begining PHP and my SQL and I've read a book about them. But I was
    wondering, I hear JSP is even better, harder, but better. If you have some good reasons about why
    this language is so good, do tell. Thanx.....
  4. [question] Php / Jsp ?
    What's the difference between PHP & JSP? (0)
    Since my next project in my school will start soon, students in my course have been allowed to
    choose between PHP and JSP to create a simple e-commerce website. I would like to ask the
    differences between the two languages. Which of them would be better for creating such a site?
    What's the main differences between the two languages? Thanks for your help.....
  5. What's A Good Open Source That Has...
    (1)
    good emoticons? i wanna allow users on my message boards to post them, but i also don't wanna
    steal any images without permission... good links, anyone? thanks in advance!....
  6. What's The Best Place To Learn Php?
    help a newb get started (11)
    I've never touched PHP or MySQL before /unsure.gif' border='0' style='vertical-align:middle'
    alt='unsure.gif' /> . My experience is regular HTML and CSS. Could someone please link me to a
    site with a good, easy, free online tutorial for a newb like me? Thanx much in advance!
    /smile.gif' border='0' style='vertical-align:middle' alt='smile.gif' /> ....
  7. Mysql Errors
    cant find whats wrong :( (3)
    I am working on my guestbook, better to say I am transfuring it from old to new site, but I got some
    errors now I did not had at my old hoster and I cannot figure out whats wrong: CODE
    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in
    /home/pbrugge/public_html/guest.php on line 104 Warning: mysql_fetch_array():
    supplied argument is not a valid MySQL result resource in /home/pbrugge/public_html/guest.php on
    line 110 This is the complete relevant code perhaps I overlooked something but I keep ove....

    1. Looking for whats, wrong

*RANDOM STUFF*





*SIMILAR VIDEOS*
Searching Video's for whats, wrong

*MORE FROM TRAP17.COM*
advertisement



Can Some One Tell Me Whats Wrong With This



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute your information that might help someone here.
Ask your Doubts & Queries to get answers.. "Together, We enlight each other!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE