|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (5 bit)
Join Date: Sep 2005
Posts: 30
|
PHP help for my little project
Hello php coders!
![]() Well, me and a couple friends are working on a game... nothing fancy, just for me and the members of my website to hopefully enjoy. Anyway, I'm fairly new to php and sql (I've really only used it to make very simple changes on my forums, or to apply preconstructed modifications). Here's the issue... I've successfully created a registration (maybe I should say modified a registration, based on a tutorial I read)... but I'm having issues with the login file that goes with it. This is what I have right now: PHP Code:
I'm sure it's a simple problem, but what did I do wrong? |
|
|
|
|
|
#2 |
|
Staff
Premium Member
Join Date: Jul 1999
Location: Arlington, TN
Posts: 5,538
|
Is the password encrypted when it goes into the database?
__________________
Want to Make $$$$ with your Computer? No Risk! Simply press shift-4 four times in a row |
|
|
|
|
|
#3 | |
|
Come in Ray...
Join Date: Sep 2004
Posts: 1,668
|
Quote:
|
|
|
|
|
|
|
#4 |
|
Member (5 bit)
Join Date: Sep 2005
Posts: 30
|
It is m5d when it gets placed into the database... I'll see if the plain text works... thanks for the thoughts.
|
|
|
|
|
|
#5 |
|
Chop Chop
|
You want to keep it encrypted, but you need to also encrypt the one entered from the login field. Right now you are checking the md5 encrypted password against a none encrypted password, so they don't match. You need to encrypt the password entered from the login field and then match it against the one in the database.
|
|
|
|
|
|
#6 |
|
Member (5 bit)
Join Date: Sep 2005
Posts: 30
|
Hmm... this line should be changing the posted password to md5 before comparing:
PHP Code:
|
|
|
|
|
|
#7 |
|
Come in Ray...
Join Date: Sep 2004
Posts: 1,668
|
To debug this, I would recommend removing any kind of encryption you have on your passwords, both in the database and the submit code. Test to make sure it is working with nothing encrypted. Then go back and add the encryption stuff. This way you can find out if your code is wrong or your encryption is out of sync.
|
|
|
|
|
|
#8 | |
|
Staff
Premium Member
Join Date: Jul 1999
Location: Arlington, TN
Posts: 5,538
|
Quote:
You might also go ahead and do a trim on the password as well to avoid any errors. |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|