Jump to content

Why I get popup to select users from database?


eevan79

Recommended Posts

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:

wtfjhv.jpg

 

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??

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

There is not code for the popup. Thats strange.  :confused:

 

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...

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.