note 43031 deleted from function.md5-file by aidan
| From: | aidan@php.net | Date: | Sun, 12 Sep 2004 22:56:03 +0000 |
| Subject: | note 43031 deleted from function.md5-file by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-76559@lists.php.net to get a copy of this message | ||
Note Submitter: raja shahed at christine nothdurfter dot 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";
}