Hi, I have been coding a sign-up script for a site that I am creating. Can you tell me how I should go about turning the password into an md5' hash.
<?
$check = "select id from $table where username = '".$_POST['username']."';";
$qry = mysql_query($check) or die ("Could not match data because ".mysql_error());
$num_rows = mysql_num_rows($qry);
if ($num_rows != 0) {
echo "Sorry, there the username $username is already taken.<br>";
echo "<a href=/?register>Try again</a>";
exit;
} else {
// insert the data
$insert = mysql_query("insert into $table values ('NULL', '".$_POST['username']."','".$_POST['email']."','".$_POST['fullname']."','".$_POST['day']."','".$_POST['month']."','".$_POST['year']."','".$_POST['gender']."','".$_POST['country']."' ")
or die("Could not insert data because ".mysql_error());
// print a success message
echo "Your user account has been created!<br>";
echo "Now you can <a href=/?login>log in</a>";
}
?>
Connecting to mysql etc. is all done above using functions in functions.php, hope you lot here can help.
Regards,
-Chris