|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
problem with user authent.
Hi. First, i want to say: "Sorry for my English"
Now, I have some problem with user Authentification. I did as written in the article on this site, but result of my work NULL, Somebody please write simple PHP code of authentification and user logging, Sorry, for English ![]() |
|
#2
|
|||
|
|||
|
wolandin,
I assume you're referring to Havard's article... Would you mind posting some of the code you're having problems with? It'll help us help you! PS: Welcome to DevArticles!
__________________
____________________________________________ Developer Shed Weekly Writer | DevArticles Forum Moderator Build Your Own KlipFolio Klip With PHP FrankManno.com - Under Construction Design Interactive Group - Under Construction |
|
#3
|
|||
|
|||
|
Thanks for response.
<?PHP function displayLogin() { header("WWW-Authenticate: Basic realm=\"My Website\""); header("HTTP/1.0 401 Unauthorized"); echo "<h2>Authentication Failure</h2>"; echo "The username and password provided did not work. Please reload this page and try again."; exit;} Browser sent me a message: "Header already sent... etc" and message "Authentication Failure The username and password provided did ... " etc How I can correct that error. May be I did something wrong early? Can you describe principle of work header() function? |
|
#4
|
||||
|
||||
|
Headers can be tricky. For example, if you print something to the screen and then try to send an authentication header, you'll get the error you've described, because once you print to the screen, the assumption is that all headers have been sent. You might get around this problem by using the ob_start() and ob_end_flush() functions, but it would probably be better to rework your code so that you're performing tasks in a logical order.
I'll bet, for example, that you're printing some text to the screen prior to executing your displayLogin() function. If you move displayLogin() to the top, before any text is printed to the screen, you might find your problem solved. |
|
#5
|
|||
|
|||
|
FrankieShakes,
No, I would lose dispute. Nothing early. <?php function displaylogin(){ ......................... exit;} Please right example of code of similar function. I can`t but I must. ![]() |
|
#6
|
|||
|
|||
|
I found error.
Author create userId, but work with id, also anothe rows, |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > problem with user authent. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|