Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

User login authentication 1

Status
Not open for further replies.

hex6007

MIS
Sep 2, 2008
53
PH
please help how to check if the user or redirect the user to the login page first before going to my homepage.

thanks in advance.
 
i think that your host address is unlikely to be right.

when you say that that message, i assume that you are talking about a mysql message or are you talking about the message generated by my code 'Either your username or password is incorrect'

if the latter then make sure that in the database your password is encrypted with sha1().
 
The latter is the case. It displays the message from your script. How do I encrypt my password with sha1() on my phpmyadmin?

Thanks

The host address posted here is not the real one, I just altered the info because am posting it in a forum. Thanks

 
to encrypt your password run this query in phpmyadmin

Code:
update tablename set pwd = sha1(pwd)

note that this will encrypt ALL passwords in that table.
 
done that but still getting "

Either your username or password is incorrect

Username"

Even though the username and password I am using both exist on the DB table... any more ideas please?
 
umm. nope. no ideas! it works for me.

check your database to make sure that your password has updated correctly. it should now be an sha1 hash of your original password.
 
for jpadie,
Below is the error that appears:

Cannot connect: SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES)

 
well you can be sure then that your database is configured to refuse connections from the root user connected via localhost. you need to check the privileges table to fix that. this is a mysql issue.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top