Reset Password PHP

uwe24

New member
Hey Community,

I am starting to learn php and pdo and i am starting to make a personal project for myself to improve my skills are php and pdo. But there are a few problems that i have and one of the main ones are making a page for users to reset their password. That may be simple for many of you but as i am new to php and pdo i dont even know where to start. If someone can give me the full script for ressetting users password page i would be very gratefull because i have searched everywhere including google and tried everything and nothing works because the script was trying to get hold of a database that was named differently to mine and i couldnt find out how to change it or something like that. Im not sure which script you need to make the reset password script work so just ask me and i will post the script on here for you and i will tell you the database name so you can link it to my database. I also need the script to check if the user is logged in because i think all of the scripts need the script to check if the user is online or unless you can put it in the actual reset password script. Also if you could include the .sql file if you include something else such as questions for the user. Also the website i am making is not for a lastchaos server so dont link it to a lastchaos server.

I would also appreciate it if it comes with the email script as well that sends the email to the user once resetted or request to be resetted but i wouldnt be much bothered if it didnt come with that as long as the reset password script worked for me or even instructions on how to make the reset password script work.


Database name that holds the members is called members

Thanks In Advanced
 

aandreyy96

New member
We can't post a script that works for you as long as we don't have any details about your project, code, database and structure. There is no such thing as a universal script for resetting passwords. Each script, website or project has a different script for resetting passwords because is built on the project's structure.

We need the name of the database, the name of the table that contains the members/users, and the structure of that table. If you can also post the registration code it's better. I can make the script for resetting password in the way that your registration code is made.
 

un4saken

Administrator
You can try to send a random number to the user while storing the same number to the user table. And then match it during the reset procedure. It is easy.

Logic is:

User Reset -> Create a random number -> Send it to the user -> Store the number in a table

Reset procedure:

User clicks the link in the mail which asks for username, email and the code.
user input that number -> if match, change the password with the new one