6
I use 2 pages, one to insert the email (forgotPassword.php
) that still only has graphic design. And the recuperar.php
which will serve for the user to change his password.
My user table (where the registered staff go) has the columns ID
, Nome
, password
, Email
, Telemovel
, and idUtilizador
.
I need a PHP function that restores the user’s password and allows you to change it.
PS: My database is Mysqli.
Post an example of what you tried.
– Diego
@Guilhermelautert correct expression. No syntax errors.
– Wallace Maxters
I tried several tutorials on google, I will not put here all the ways I tried...
– Bruny
User table does not have password column?
– gustavox
You should develop a script for this, there is no tutorial that will tell you how to do it. On the page
recuperar.php
should receive at least the email, you need to check if it exists in the database. If it exists you send an email to it with a page created to generate new password. It would be important to generate a maturity hash of the url you will check when opening and on this screen you should allow it to change the password. As our colleague Wallace said, you should create the logic that best suits your problem solution.– Marcelo Gomes
Hmmm understood... What code is used to send emails?
– Bruny
@Bruny take a look at this tutorial -> http://blog.thiagobelem.net/enviar-e-mails-pelo-php-usando-o-phpmailer/ is well explained and simple to understand.
– Thomas Lima