note 43030 deleted from function.md5-file by vincent
| From: | vincent@php.net | Date: | Thu, 10 Jun 2004 07:04:00 +0000 |
| Subject: | note 43030 deleted from function.md5-file by vincent | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-70824@lists.php.net to get a copy of this message | ||
Note Submitter: raja shahed @ christine nothdurfter .com
----
//Inserting Password into mySQL Database as an md5.
$username = isset($_REQUEST["username"]) ? $_REQUEST['username'] : "";
$pwd = isset($_REQUEST["password"]) ? $_REQUEST['password'] : "";
$dbconection = mysql_connect("yourhost","username","password");
$md5pwd = md5($pwd) ;
// easiest way
$iq = "INSERT INTO mytable(username, password) VALUES ('$username',
'$md5pwd') ;
$result = mysql_query($iq);
if(mysql_affected_rows ($dbconection)>0)
{
echo "User name and Password are inserted with success";
}
else
{
echo "failed inserting username and password";
}