confirming password
Posted: Wed Mar 09, 2005 2:13 am
here's my verify passwordword code in my registration page
and here's my mysql query
it works well but there is one error i encounter....when the characters in the password textbox and confirm password textbox do not match, an error occur pointing to this line
saying
feyd | hey look ma,
Code: Select all
if (empty($_POSTї'password1']))
{
$pw = FALSE;
$message .= 'Enter your password!<br>';
}
else
{
if ($_POSTї'password1'] == $_POSTї'password2'])
{
$pw = $_POSTї'password1'];
}
else
{
$message .= 'Your password did not match the confirmed password!<br>';
}
}Code: Select all
if ($fn && $ln && $c && $s && $d && $l && $e && $un && $pw)
{
$query = "INSERT INTO users(firstname, lastname, company, status, description, location, email, username, password)
VALUES('$fn','$ln','$c','$s','$d','$l','$e','$un', md5('$pw'))";
$result = @mysql_query($query);
if ($result)
{
echo '<b/>User has been registered<br>';
exit();
}
else
{
$message .= '<b/>User cannot be registered due to system error!<br>'.mysql_error();
}Code: Select all
if ($fn && $ln && $c && $s && $d && $l && $e && $un && $pw)can anyone spot the problem??Notice: Undefined variable: pw in c:\inetpub\wwwroot\reports\registerbody.php on line 115
feyd | hey look ma,
Code: Select all
is on. [/color]