Chapter 16 'Register' does not write to database
I am having an issue where if someone registers the information is not being sent to database at all. I've checked the code and can't understand why. I debugged the code and followed it and it seems to skip in transact-user.php at:
case 'Create Account':
if (isset ($_POST['name'])
and isset ($_POST['email'])
and isset ($_POST['passwd'])
and isset ($_POST['passswd2'])
and $_POST['passwd'] == $_POST['passwd2']) {
$sql = "INSERT INTO forum_users " .
"(email, name, passwd, date_joined, last_login) " .
"VALUES ('" . $_POST['email'] . "','" .
$_POST['name'] . "','" . $_POST['passwd'] . "','" .
date("Y-m-d H:i:s", time()). "','" .
date("Y-m-d H:i:s", time()). "')";
mysql_query($sql, $conn)
or die ('Could not create user account; ' . mysql_error());
This is being called from useraccount.php from the $mode = "Create";
Any help would be appreciated.
|