Jump to content

MD5 into Database


Xoom3r

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.