Xoom3r Posted May 3, 2010 Share Posted May 3, 2010 I'll explain below. This is my form: <form action="adduser.php" method="POST"> <input type="text" name="user" maxlength="30" value="username"> <input type="password" name="pass" maxlength="30" value="******"> <input type="text" name="email" maxlength="50" value="[email protected]"> <input type="submit" value="Add a user"> </form> My adduser.php file: <?php $username = $_GET["user"]; $password = $_GET["pass"]; $email = $_GET["email"]; $userid = "5aa566145e6bd236e9e197728d7bb4da"; $userlevel = "1"; $ts = "1272866610"; $con = mysql_connect("localhost","asgenesy_root","<LOLPASSWORD>"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("asgenesy_users", $con); mysql_query("INSERT INTO users (username, password, userid, userlevel, email, timestamp) VALUES ('$username', '$password', '$userid', '$userlevel', '$email', '$ts')"); mysql_close($con); ?> What I would like to do.. Is hash the password into MD5, and then insert it.. How can I do that? Link to comment https://forums.phpfreaks.com/topic/200530-md5-into-database/ Share on other sites More sharing options...
Deoctor Posted May 3, 2010 Share Posted May 3, 2010 do some thing like this $password = md5($_GET["pass"]); Link to comment https://forums.phpfreaks.com/topic/200530-md5-into-database/#findComment-1052259 Share on other sites More sharing options...
Xoom3r Posted May 3, 2010 Author Share Posted May 3, 2010 Thank you very much for the fast reply but I already got it Link to comment https://forums.phpfreaks.com/topic/200530-md5-into-database/#findComment-1052260 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.