Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Apr 2003
Posts: 6
Lurker
Lurker
Offline
Joined: Apr 2003
Posts: 6
I have a simple PHP login script that checks username and password in a table called 'user' in a database called 'secret'.

The PHP script is checking as such:
$db = mysql_connect("localhost", "myuser", "mypassword");
mysql_select_db("secret")
SELECT id from user WHERE username = '$user' AND password = MD5('$pass');

$user and $pass are simply the value from the login. THe above SQL query is presenting a empty set for #user and $pass, but does return the id.

So my questions is, how do I add a MD5 password to the password field ( $pass ) for the $user ?

I've tried: SELECT MD5('mypasswordhere'); and this does spit out a MD5 encrypted password for 'mypasswordhere' but how do I get it in the password field?

michael

Sponsored Links
Entire Thread
Subject Posted By Posted
MySQL encrypted passwd that PHP can see viporx 04/19/2003 8:59 PM
Re: MySQL encrypted passwd that PHP can see Dave_L_dup1 04/19/2003 9:12 PM
Re: MySQL encrypted passwd that PHP can see viporx 04/19/2003 10:03 PM
Re: MySQL encrypted passwd that PHP can see Dave_L_dup1 04/19/2003 10:23 PM
Re: MySQL encrypted passwd that PHP can see dimopoulos 04/21/2003 7:19 PM

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
• Shock Hosting
• Stable Host
• bluehost
• InterServer
Visit us on Facebook
Member Spotlight
badfrog
badfrog
somewhere on the coast of Maine
Posts: 94
Joined: March 2007
Forum Statistics
Forums63
Topics37,583
Posts293,956
Members13,826
Most Online151,614
Nov 14th, 2025
Today's Statistics
Currently Online 22650
Topics Created 0
Posts Made 1
Users Online 2
Birthdays 24
Top Posters
AllenAyres 21,080
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,834
Greg Hard 4,625
Top Posters(30 Days)
isaac 1
Top Likes Received
isaac 82
Gizmo 20
Brett 7
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2026 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.1.0
(Snapshot build 20260108)