Well, it looks like every time I encrypt the password it would give me problem. Here's the code for the input (this is only the part for the password):
if (preg_match ('/^[[:alnum:]]{4,20}$/', stripslashes(trim($_POST['password1'])))) {
if ($_POST['password1'] == $_POST['password2']) {
$p = escape_data($_POST['password1']);
} else {
$p = FALSE;
echo '<p><font color="red" size="+1">Your password did not match the confirmed password!</font></p>';
}
Here's the other for inserting it on my database:
$query = "INSERT INTO students_info (first_name, middle_name, last_name, address, contact, email_add, username, password) VALUES ('$fn', '$mn', '$ln', '$add', '$contact','$e', '$un', sha1('$p'))";
I tried both SHA and SHA1 but neither works. If I remove the single quotes, it would give me error messages. I tried removing SHA1 or SHA and it worked fine. Thanks for the reply, really appreciate it.