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="name@example.com"> <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? Quote Link to comment 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"]); Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.