the image above say what the problem i face to.
if the password and confirm password is not the same,
the box prompt up to choose my DB user.why???
here my code :
else if($_POST['submit']=='Save')
{
// If the Save form has been submitted
$err = array();
if($_POST['confirmset'] != $_POST['setpass'])
{
$err[]='please make sure your password and confirm password is correct!';
}
if($_POST['setpass'] == NULL || $_POST['confirmset'] == NULL)
{
$err[]='You must filled up all the field!';
}
if(strlen($_POST['setpass'])<6 || strlen($_POST['setpass'])>20)
{
$err[]='Your password must be between 6 and 20 characters!';
}
if(!count($err) && $_POST['confirmset'] == $_POST['setpass'])
{
mysql_query("UPDATE tz_members SET pass='".md5($_POST['setpass'])."' WHERE id = '".$_SESSION['id']."' LIMIT 1") or die(mysql_error());
$_SESSION['msg']['save-success']='Saved';
}
if(count($err))
{
$_SESSION['msg']['save-err'] = implode('<br />',$err);
}
header("Location: index.php");
exit;
}
but when the confirmset and setpass = same,the password changed(image below)
what wrong with the code?
here is the full source