Hi,
I am new to the php scripting and trying to make a registration page.
I have got the script working but i need to md5 protect the passwords.
Could someone help me with this please?
Edit: Managed to fix the problem my self by changing
To
Thanx
Chris
I am new to the php scripting and trying to make a registration page.
I have got the script working but i need to md5 protect the passwords.
Could someone help me with this please?
PHP:
<?php
include ("db_connect.inc");
$query="INSERT INTO accounts (login,password) VALUES ('$_POST[login]','$_POST[password]')";
if(!mysql_db_query($dbname,$query,$link_id)) die(mysql_error());
echo "success in database entry.";
echo "<br />";
echo "User added to database.</a>";
?>
Edit: Managed to fix the problem my self by changing
PHP:
$query="INSERT INTO accounts (login,password) VALUES ('$_POST[login]','$_POST[password]')";
To
PHP:
$query = sprintf( "INSERT INTO accounts (login,password) VALUES ('%s','%s')", addslashes($_POST['login']), md5($_POST['password']));
Thanx
Chris
Last edited: