开发者

php problem,whatwrong?

开发者 https://www.devze.com 2022-12-21 01:08 出处:网络
alt text http://img37.imageshack.us/img37/9131/24689399.png the image above say what the problem i face to.

alt text http://img37.imageshack.us/img37/9131/24689399.png

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)

alt text http://img19.imageshack.us/img19/1867/44835628.png

what wrong with the code?

here is the full source


Confirm password change is the Firefox feature. Firefox save the username and password combination for a website. When you enter a username with a different password into a form in the same website, Firefox will detect this as change password. When you have several username stored in that website, then Firefox will ask, the new password is for which username.


Looks like your popup is being called by javascript. Check that it's not being called when you have your errors.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号