This is a discussion on "[SOLVED] Log In Script Encryption?" within the PHP Forum section. This forum, and the thread "[SOLVED] Log In Script Encryption? are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
[SOLVED] Log In Script Encryption?
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
||||
|
||||
|
[SOLVED] Log In Script Encryption?
Hi Guys,
I followed a tutorial here: http://www.phpeasystep.com/workshopview.php?id=6 but it didn't include Encryption. I then looked at another tutorial: http://www.phpeasystep.com/workshopview.php?id=26 I'm attempting to make a simple CMS for just my site, and so far I have been working on a local server, and so far so good. I attempted to add encyption to the CMS usernames, login, etc. First is the script were the user adds an admin account to their site:
When I added a user it all went fine. I did a username of 'admin', and password of 'test'. Then, I tried to log in. Log In page:
Thanks! jack
__________________
Jack Franklin - Webforumz Moderator (x)HTML | CSS | PHP | MySQL | JQuery (Javascript) Contact: My Blog | Twitter | Delicious Want Lessons? PM me. If you think I've helped, please press the 'Thanks' Button.
Last Blog Entry: A Week with VBulletin (Aug 28th, 2008)
|
|
|
|
#2
|
||||
|
||||
|
Re: Log In Script Encryption?
No. For when a user is logging in, you must select the username with the password e.g.
Quote:
__________________
Marc Staff Manager - Webforumz.com Want to be a moderator? PM me. |
|
#3
|
||||
|
||||
|
Re: Log In Script Encryption?
I would disagree with Mark on his point.. There is no need to bring the password into PHP at all...
If you have stored the password in its encrypted form in the MySQL database it is simple a matter of comparing the user name and password at the same time. In your database, do you actually have the password encrypted? If you do, have you made sure that the column is "var_char(32)".. MD5 returns a 32 character string so if the database doesn't have enough space it will truncate it and the passwords won't match.
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
Last edited by Rakuli; Jan 6th, 2008 at 11:06. |
|
#4
|
||||
|
||||
|
Re: Log In Script Encryption?
The password field is varchar(65). Is that ok?
So, is my code fine? I'm going to try again just to make sure I did enter a password of test! No luck, just says wrong username or password. I then tryed entering the 32character encrypted password in the login page, but still no luck.
__________________
Jack Franklin - Webforumz Moderator (x)HTML | CSS | PHP | MySQL | JQuery (Javascript) Contact: My Blog | Twitter | Delicious Want Lessons? PM me. If you think I've helped, please press the 'Thanks' Button.
Last Blog Entry: A Week with VBulletin (Aug 28th, 2008)
Last edited by Jack Franklin; Jan 6th, 2008 at 10:56. |
|
#5
|
||||
|
||||
|
Re: Log In Script Encryption?
Can you show me how you're entering the details into the database, do you have a script that does this?
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
#6
|
||||
|
||||
|
Re: Log In Script Encryption?
The user enters the details in this lovely form:
__________________
Jack Franklin - Webforumz Moderator (x)HTML | CSS | PHP | MySQL | JQuery (Javascript) Contact: My Blog | Twitter | Delicious Want Lessons? PM me. If you think I've helped, please press the 'Thanks' Button.
Last Blog Entry: A Week with VBulletin (Aug 28th, 2008)
|
|
#7
|
||||
|
||||
|
Re: Log In Script Encryption?
Okay, I don't see any glaring errors in either code snippets..
In your login script try changing the encryption line to:
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
#8
|
||||
|
||||
|
Re: Log In Script Encryption?
Rakuli, Thanks for your help so far
I changed it, so the code is now like this:
Parse error: syntax error, unexpected T_STRING in C:\xampp\htdocs\Dolphin CMS\pg_administration\pg_check_login.php on line 19 I cannot quite see where I am going wrong.
__________________
Jack Franklin - Webforumz Moderator (x)HTML | CSS | PHP | MySQL | JQuery (Javascript) Contact: My Blog | Twitter | Delicious Want Lessons? PM me. If you think I've helped, please press the 'Thanks' Button.
Last Blog Entry: A Week with VBulletin (Aug 28th, 2008)
|
|
#9
|
||||
|
||||
|
Re: Log In Script Encryption?
Which is line 19? This is a sytax error -- usually means that there is a missing semi colon or quotes not closed.. I can't seem to see it though.
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
#10
|
||||
|
||||
|
Re: Log In Script Encryption?
Line 19:
__________________
Jack Franklin - Webforumz Moderator (x)HTML | CSS | PHP | MySQL | JQuery (Javascript) Contact: My Blog | Twitter | Delicious Want Lessons? PM me. If you think I've helped, please press the 'Thanks' Button.
Last Blog Entry: A Week with VBulletin (Aug 28th, 2008)
|
|
#11
|
||||
|
||||
|
Re: Log In Script Encryption?
Try replacing it with
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
#12
|
||||
|
||||
|
Re: Log In Script Encryption?
Ok no error now. It just saids 'Wrong Username or Password'.
__________________
Jack Franklin - Webforumz Moderator (x)HTML | CSS | PHP | MySQL | JQuery (Javascript) Contact: My Blog | Twitter | Delicious Want Lessons? PM me. If you think I've helped, please press the 'Thanks' Button.
Last Blog Entry: A Week with VBulletin (Aug 28th, 2008)
|