User Registration Form

Back to previous page

\n"; $password_match = true; $email_address_valid = true; if ($HTTP_GET_VARS['submit'] == "Submit") { $old_password = $HTTP_GET_VARS['old_password']; $password = $HTTP_GET_VARS['password']; $confirm_password = $HTTP_GET_VARS['confirm_password']; if ($password != $confirm_password) { $password_match = false; } if ($password != "" && $confirm_password != "" && $password_match) { $link = db_connect_admin(); /* // Check that the old password is correct $query = "SELECT password FROM ". USERS_TABLE . " WHERE username = '". $_SESSION['username'] . "'"; $result = mysql_query($query); $row = mysql_fetch_row($result); if ($row[0] != $old_password) { echo "Old password is incorrect\n"; } */ // Need to insert some SQL here to add the person's details $sql_update = "UPDATE ".USERS_TABLE." SET password = '$password' where username = '" . $_SESSION['username'] . "'"; //echo "query = $sql_update
\n"; mysql_query($sql_update); //echo "Records added = " . mysql_affected_rows() . "
\n"; if (mysql_affected_rows() > 0) { echo "Successfully updated your password
\n"; } mysql_close($link); } else { ?>
Password Change
* Password: Required"; }?>
* Confirm Password: Passwords don't match\n"; } ?>