How to reset password created in PHP
Hello
I need to modify this code for users who have forgotten their password.
the problem is if one user have more profiles with same email - then this script can’t send the user name and password.
Example
user name : saman
email: 'myid@test.com'
user name: dheerajp
email:"myid@test.com"
I have created these above two accounts with the same email address, and I cannot access anyone of these so how do I recover that, and all the coding have done in the PHP.
please help.
Re: How to reset password created in PHP
According to me you must not allow a user to create multiple IDs with a single email address.
Do you asking for the code? I think if you allow an user to have multiple IDs with single email ID then you have to provide total information to that person with the mail ID. You need to give all IDs & their Passwords to that user when he forgets any of the id or password.
Sorry if am not able to understand what you are asking for?
Re: How to reset password created in PHP
don't allow multiple accounts with same email address solves the problem. single account per email address only.
another way would be for forgotten password you request both email address and username to do the lookup with instead of just email.
also if you encrypt the passwords in the db (like you should be doing) then you can't actually email them their password but instead you must provide a forgot password update script
Re: How to reset password created in PHP
Please provide me code so that I could apply it to my existing code and check if I get anything happens for me.
Re: How to reset password created in PHP
Hi there you problem is simply your query this is an easy fix try this Sql Query
PHP Code:
$Query = mysql_query("SELECT * FROM `profiler` where `email` = '" . mysql_real_escape_string($_POST['mail']) . "' AND `username` = '" . mysql_real_escape_string($_POST['username']) . "';");
dont forget to escape your varibles that are untrusted.... you never know what they might be trying to do :|