eevan79 Posted July 15, 2010 Share Posted July 15, 2010 I almost finished code that allows users to change their password. But when type different password and confim password I get popup window to select all users from mysql database which I want to change password. Here is screenshot: And code: I almost finished code that allows users to change their password. But when type different password and confim password I get popup window to select all users from mysql database which I want to change password. Here is screenshot: And code: [code=php:0]<?php include ('header.php'); if (mysql_real_escape_string($_GET['changepass']) == 1) { if ($_SERVER['REQUEST_METHOD'] != 'POST') { //FORM CHANGE PW $passkey = mysql_real_escape_string($_GET['passkey']); $result = mysql_query("SELECT user_name, user_pass, confirm_code FROM " . $table_prefix . "users WHERE confirm_code = '" . mysql_real_escape_string($_GET['passkey']) . "'") or die(mysql_error()); if (mysql_num_rows($result) == 0) { echo '<br><b>Information</b><hr/><br/><div align="center"><font color="red">Wrong confirmation code or you have already changed your password.</font><br /><a class="loginlink" href="index.php"><br />Back to forum index</a>.</div><br />'; } else { echo ' <h3>Change your password</h3><br /> <div align="center"><span id="msg"></span></div> <form method="post" action=""> <table class="registration" border=1><tr> <th><b> Change password</b></th> <th><b></b></th></tr> <tr> <td width="220" height="36"><div align="right">Password: </div></td><td> <div align="left"> <input size="30" type="password" name="user_password" /> </td> <tr> <td height="36"><div align="right">Confirm password:</div></td><td> <div align="left"><input size="30" type="password" name="user_pass_check" /></div></td></tr> </div></table> <br /> <table class="registration" border=1> <tr> <td height="36"><input type="submit" class="inputButton" value="Submit" /> </td></tr></table></form> '; } } else { $errors = array(); if (isset($_POST['user_password'])) { if (strlen($_POST['user_password']) < 3) { $errors[] = 'The password field contain too few charachters.'; } if ($_POST['user_password'] != $_POST['user_pass_check']) { $errors[] = 'The two passwords did not match.'; } } else { $errors[] = 'The password field cannot be empty.'; } if (!empty($errors)) { echo '<b>Information</b><hr><br/><div align="center">Following fields are not filled in correctly.<br /><br /><tr>'; foreach($errors as $key => $value) /* walk through the array so all the errors get displayed */ { echo '<td><font color="red">' . $value . '<br /></td></tr></font>'; } echo '<br /><a href="javascript: history.go(-1) ">Try again</a></div><br /><br />'; } else { //CHANGE PASSWORD CODE HERE die; } } } Why I get popup window?? Quote Link to comment Share on other sites More sharing options...
radar Posted July 15, 2010 Share Posted July 15, 2010 Well since in your code i am not seeing any coding for the popup, im guessing it has something to do with stored passwords on the computer itself for it. Though thats just a theory... I could be completely wrong. Quote Link to comment Share on other sites More sharing options...
eevan79 Posted July 15, 2010 Author Share Posted July 15, 2010 There is not code for the popup. Thats strange. Maybe it's happening cause I SELECT cofirm code (that is sended to user mail to confirm change pw). Confirm code is generated with this code: $confirm_code=md5(uniqid(rand())); and when user click on link that contains confirmation code I must verify that code exists in database: $result = mysql_query("SELECT confirm_code FROM ".$table_prefix."users WHERE confirm_code = '" . mysql_real_escape_string($_GET['passkey']) . "'") or die(mysql_error()); And this popup only shows when I type different password and confirm password! EDIT: I remove code that check password and confirm password and the popup still shows up! EDIT2: Well since in your code i am not seeing any coding for the popup, im guessing it has something to do with stored passwords on the computer itself for it. Though thats just a theory... I could be completely wrong. You are right. I tried it on different browsers and the popup didnt show up. Only on firefox...It seems that problem is related to passwords stored in browser cache or something... Quote Link to comment Share on other sites More sharing options...
eevan79 Posted July 15, 2010 Author Share Posted July 15, 2010 Now I see...that is not users from mysql database. That popup shows up users that is login on website (from local browser). When I insert another <input field that is not password type, popup dont show up. Strange. Quote Link to comment Share on other sites More sharing options...
radar Posted July 16, 2010 Share Posted July 16, 2010 Thats what I thought, its a windows popup, as it is reading that you're changing the password for a user that has been previously stored in windows password storage facility... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.