alt text http://img37.imageshack.us/img37/9131/24689399.png
上面的图片说明了我面临的问题。
如果密码和确认密码不同,
框提示选择我的数据库用户。为什么?你说什么?
这里是我的代码:
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;
}
但当confirmset和setpass=相同时,密码更改(如下图所示)
alt text http://img19.imageshack.us/img19/1867/44835628.png
密码怎么了?
这里是
full source