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 |
|
||||
|
[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
__________________
Resources Administrator
Grilling Gurus - Interviews with the Best Web Designers and Developers in the Industry Got a Question for Ryan Carson and his Web Design/Development team Carsonified? Jack Franklin - My Blog (It's a Pen in My Mouth BTW)
Last Blog Entry: My Latest Project - Grilling Gurus... (Jun 11th, 2008)
|
|
|
|
||||
|
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. |
|
||||
|
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.
__________________
Resources Administrator
Grilling Gurus - Interviews with the Best Web Designers and Developers in the Industry Got a Question for Ryan Carson and his Web Design/Development team Carsonified? Jack Franklin - My Blog (It's a Pen in My Mouth BTW)
Last Blog Entry: My Latest Project - Grilling Gurus... (Jun 11th, 2008)
Last edited by Jack Franklin; Jan 6th, 2008 at 10:56. |
|
||||
|
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)
|
|
||||
|
Re: Log In Script Encryption?
The user enters the details in this lovely form:
__________________
Resources Administrator
Grilling Gurus - Interviews with the Best Web Designers and Developers in the Industry Got a Question for Ryan Carson and his Web Design/Development team Carsonified? Jack Franklin - My Blog (It's a Pen in My Mouth BTW)
Last Blog Entry: My Latest Project - Grilling Gurus... (Jun 11th, 2008)
|
|
||||
|
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)
|
|
||||
|
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.
__________________
Resources Administrator
Grilling Gurus - Interviews with the Best Web Designers and Developers in the Industry Got a Question for Ryan Carson and his Web Design/Development team Carsonified? Jack Franklin - My Blog (It's a Pen in My Mouth BTW)
Last Blog Entry: My Latest Project - Grilling Gurus... (Jun 11th, 2008)
|
|
||||
|
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)
|
|
||||
|
Re: Log In Script Encryption?
Line 19:
__________________
Resources Administrator
Grilling Gurus - Interviews with the Best Web Designers and Developers in the Industry Got a Question for Ryan Carson and his Web Design/Development team Carsonified? Jack Franklin - My Blog (It's a Pen in My Mouth BTW)
Last Blog Entry: My Latest Project - Grilling Gurus... (Jun 11th, 2008)
|
|
||||
|
Re: Log In Script Encryption?
Try replacing it with
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
||||
|
Re: Log In Script Encryption?
Ok no error now. It just saids 'Wrong Username or Password'.
__________________
Resources Administrator
Grilling Gurus - Interviews with the Best Web Designers and Developers in the Industry Got a Question for Ryan Carson and his Web Design/Development team Carsonified? Jack Franklin - My Blog (It's a Pen in My Mouth BTW)
Last Blog Entry: My Latest Project - Grilling Gurus... (Jun 11th, 2008)
|
|
||||
|
Re: Log In Script Encryption?
Hmmm.. interesting..
Have you tried removing the encryption from this file and just checking password against password? Copy the password from mysql and paste it into the text box, then remove the MD5 from the login file and see if you get a match that way
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
||||
|
Re: Log In Script Encryption?
Maybe it's the data that's already in there.
If you have PHPmyadmin add a new user with this info: username: user password: 5f4dcc3b5aa765d61d8327deb882cf99 (it's just "password" md5()'d). And try logging in with user/password.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
||||
|
Re: Log In Script Encryption?
Thanks guys, no luck! I found a new tutorial, however, and followed it, and this one is working. So it will remain a mystery!
Thanks for the help though
__________________
Resources Administrator
Grilling Gurus - Interviews with the Best Web Designers and Developers in the Industry Got a Question for Ryan Carson and his Web Design/Development team Carsonified? Jack Franklin - My Blog (It's a Pen in My Mouth BTW)
Last Blog Entry: My Latest Project - Grilling Gurus... (Jun 11th, 2008)
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [SOLVED] Search Script | longstand | PHP Forum | 5 | Nov 14th, 2007 18:45 |
| [SOLVED] md5 encryption | dhossai | PHP Forum | 18 | Oct 30th, 2007 05:29 |
| [SOLVED] Who does my PHP script run as? | Kropotkin | PHP Forum | 3 | Oct 12th, 2007 12:07 |
| Paypal Pro, Encryption and lots more... | robbied72 | E-Commerce and Business | 3 | Sep 25th, 2007 23:56 |