note 43030 added to function.md5-file
| From: | rajashahed at christinenothdurfter dot com | Date: | Mon, 07 Jun 2004 11:03:16 +0000 |
| Subject: | note 43030 added to function.md5-file | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-70609@lists.php.net to get a copy of this message | ||
//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";
}
----
Manual Page -- http://www.php.net/manual/en/function.md5-file.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+43030
Delete -- http://master.php.net/manage/user-notes.php?action=delete+43030&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+43030&report=yes
Search -- http://master.php.net/manage/user-notes.php