General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old October 26th, 2003, 12:35 PM
wolandin wolandin is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 13 wolandin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old October 27th, 2003, 08:41 AM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,246 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
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

Reply With Quote
  #3  
Old October 27th, 2003, 09:17 AM
wolandin wolandin is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 13 wolandin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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?

Reply With Quote
  #4  
Old October 27th, 2003, 11:47 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
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.

Reply With Quote
  #5  
Old October 27th, 2003, 09:58 PM
wolandin wolandin is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 13 wolandin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.


Reply With Quote
  #6  
Old October 28th, 2003, 04:25 AM
wolandin wolandin is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 13 wolandin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Angry

I found error.
Author create userId, but work with id,
also anothe rows,

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > problem with user authent.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT