Forgot password and password reset forms using PHP and MYSQL database | PHP in Hindi
HTML-код
- Опубликовано: 17 ноя 2020
- Forgot password and password reset forms are must for a login system. In this tutorial, we will create a forgot password system in PHP with an MYSQL database. We are creating a complete login and signup system from scratch. In the previous tutorial, we completed the login form and signup form process in PHP. In this tutorial, we will create forms for forgotten password and reset the password using PHP programming and MYSQL.
The previous tutorial is here -
Registration and login in PHP , MYSQL, and Bootstrap (part 1)
• Registration and login...
Registration and login in PHP with MYSQL| Sign in and signup form using PHP (Part 2)
• Registration and login...
Update user profile by a session in PHP and MYSQL | Edit Profile image while logged in (Part 3)
• Update user profile by...
How to change login password in PHP and MYSQL | Update user password while logged in | PHP Tutorial (Part 4 )
• How to change login pa...
Forgot password and password reset forms using PHP and MYSQL database | PHP in Hindi (Part 5 )
• Forgot password and pa...
Complete Playlist
• Registration and login...
How to create a forgot password and password reset forms in PHP with MYSQL -
The forgot password and reset password forms are very important for the login system. We will follow the following steps -
1. Create a Password reset data table in the MYSQL database.
2. Create an HTML form for forgot password with username and email.
3. Find the user and insert email and token id in the password reset data table.
4. Create another form for password reset and hold token value from the URL
5. Update user password
This video tutorial has been created in the Hindi language. This is another part of PHP in Hindi series. Create a Forgot password system in PHP in Hindi.
Reference for this tutorial -
technosmarter....
Website
technosmarter.com
For any questions use our Techno Smarter QA platform.
Ask the Question
technosmarter....
or other videos by Techno Smarter...Subscribe below links!!
RUclips Channel
/ technosmarter
Facebook
/ technosmarter
Twitter
/ technosmarter
Instagram
/ technosmarter
#technosmarter #forgot #password #forgot_password_in_PHP #password-reset_form_in_PHP #forgot_form #update_form #password_update_in_PHP
Reference -
1. Forgot password and password reset form in PHP in Hindi
2. Password update system in PHP with MYSQL
3. Password update link generator in PHP and MYSQL Наука
Update user profile by a session in PHP and MYSQL | Edit Profile image while logged in (Part 3)
ruclips.net/video/fBfVvUm2N-g/видео.html
Bestest explanations on whole YTube !👍👍👍💖
Thank you for kind words .
Sir,Your channel is just wonderful.It is Amazing
Thanks for kind words .
thnx alot sir....
Most welcome
Nic
sir please help
when I clicked reset password
there is showing
Notice: Undefined variable: token in
C:\xampp\htdocs\text\login\password-reset.php on line 44
Please solve it
thank you!
Just because you are missing token in your URL .
Make sure GET token value in url .
GET token value from url and save in $token variable
Done .
@@TechnoSmarter i dont know how i missing i typed all your code correctly
It's simple if you are not getting token value from url then you will get token undefined error .
Token like
page.php?token=jdhksbskbdhbjjhhetc
$token=GET['token'];
Also the token goes with password reset link on email . You don't need to write manually .
@@TechnoSmarter okk atleast tell me why I am getting this error
Notice: Undefined variable: token in C:\xampp\htdocs\text\login\password-reset.php on line 44
did i typed something wrong code
$fetchresultok = mysqli_query($dbc, "SELECT email FROM pass_reset WHERE token='$token'");
if($res = mysqli_fetch_array($fetchresultok))
this is line 44
Already told you that you are missing token value from URL . Kindly focus comment above .
Hey!, once I put the token in the url and type in the new passwords in the input field and click on reset, It is opening the forgot-process.php file and showing white screen? Currently running on localhost though. Is it fine?
Thank You for the amazing tutorials also :-D
Kindly set token in URL.
Like
set.php?token=jckhucjvhhxjcjbvvc
Set data by this token .
Mail function will be worked on live server not on localhost .
Try on live server .
For more reference visit the tutorial page
technosmarter.com/php/forgot-password-and-password-reset-form-in-php
how can we use smtp server not mail function
You can use PHPMAILER and host SMTP . Watch it
ruclips.net/video/fvhQqy6Kang/видео.html
Fatal error: Uncaught mysqli_sql_exception: Access denied for user 'root'@'localhost' (using password: NO) in C:\xampp\htdocs\form\config.php what should i do
Try this:
Open config.inc.php file in the phpmyadmin directory
Find line 21: $cfg['Servers'][$i]['password'] = '';
Change it to: $cfg['Servers'][$i]['password'] = 'your_password';
Restart XAMPP
How to access config.inc.php file
Check in xampp/phpmyadmin directory.
@@TechnoSmarter Fatal error: Uncaught mysqli_sql_exception: Access denied for user 'root'@'localhost' (using password: YES) in C:\xampp\htdocs\form\config.php:7 Stack trace: #0 C:\xampp\htdocs\form\config.php(7): mysqli_connect('localhost', 'root', Object(SensitiveParameterValue), 'mydb1') #1 C:\xampp\htdocs\form\login.php(2): require_once('C:\\xampp\\htdocs...') #2 {main} thrown in C:\xampp\htdocs\form\config.php on line 7
Its showing like this now.
Uninstall this xampp
Download latest version
www.apachefriends.org/download.html
Install it
Then try .
how can we use smtp server
You can use PHPMAILER and host SMTP . Watch it
ruclips.net/video/fvhQqy6Kang/видео.html
Hello sir I have an issues in forget password when I enter user name it tells that the sever failed to send the message please try again. Can u solve these issue sir
Are you trying on localhost server ?
Sir in comment u mentioned to execute in live sever right?
@@TechnoSmarter ss sir
Yes , Execute on live server also check PHP mail() function works or not on your live sever . Don't forget to set you domain official email id in FromEmail variable
Like noreply@yourdomain.com
You can set any official web id to test on your live sever .
Sir can u make an video for this it will be help for us.. To create
All is ok but you can send mail because you had used other things like Cpanel and domain racer right?
Mail function will be worked on live server . It's tested and working on live
server for forgot password .
Yes , I have used cpanel of domain racer .
Use any live cpanel .
Sir I am have error in forgot process. Php in that I am facing call to undefined function random _bytes()
Which PHP version are you using?
You can create your random key function using this tutorial
technosmarter.com/qa/929/how-to-create-unique-random-id-or-token-key-in-php
How update php version in vs studio
Please bro
Code->Preference ->settings
Look for php version then change it .
Sir, I have 2 doubts...... in the forgot_process.php there are 2 email ids the noreply and the other user's email id which have been input. So, how will the website fetch that if a user forgets his password and goes for the forget password option then he'll receive email from the noreply email id only? And if not then tell me how to connect the noreply email so that the user will receive a mail from that particular email id.
And the other is that there will be multiple users. If we have inserted a default email id, what does it state? I mean, if we have already provided an email id in our code what does it represent. Will, not our code work if we leave the $_ReplyTo place blank in our code to let only the user input his own id?
Please guide me.
No reply email is just a your domain verification email without spam .
No reply means we don't want back any email from user . You can set any email of your domain.
The user email will be fetched from the database after matching entry by User .
The email goes to the related email id .
For more information you can ask question on our forum .
technosmarter.com/qa/
@@TechnoSmarter sir, if i could contact you thru any source? I'm confused🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻
will the forgot password option work without an online domain? because I'm trying a multiple times and it's not working in localhost. what do I ve to do to make it work?
Use php mailer classes instead of mail function then use your gmail host to connect online then you can send on localhost.
Yes , you can contact . Social links are available in the description box or search technosmarter on insta or Facebook .
If you are using only PHP it selects value from checked checkbox (Selected ) . The value disappers when you uncheck. For more reference technosmarter.com/qa/349/add-combobox-in-html-form-and-select-insert-data-using-php
Hello sir, I used your source code but when i run password-reset or forgot_password it shows me account page. Pls help me
Make sure you are using password reset code in that file .
Account is another file and password reset another file.
Also try password reset and forgot password files on live server .
Setup your details for mail function .
Mera The server failed to send the message problem aa rha hai help
Aap live server par run kar rahe ho ki localhost par ??
Sir, login page me image nahi load ho rahi logo ki...image.png krke kiya maine.. fir bhi.
Apna path check kijiye ya check kijiye image ka format kya h ye simple HTML ka code hota hain one line ka aap yahan par samajh sakte hain
technosmarter.com/html/HTML-image-src-attributes.html
Fatal error: Call to undefined function random_bytes() in C:\xampp\htdocs\login_preview\forgot_process.php on line 15 plz fix this
What is your PHP version ?
Use PHP 7.4 VERSION because random_bytes() function introduced in PHP 7 .
sir when i use to give email-id and click send link this message arrives ->The server failed to send the message. Please try again later.. can you please tell how to solve this sir
I think you are executing on localhost .
Kindly execute on live server .
It will work on live server .
Ss sir
Sir is there is any tutorials u have made for live sever execution purpose?
It's based on live server also you can watch it for mail function .
ruclips.net/video/I6IR4p0u97c/видео.html
it gives error inpassword reset page... line 45 undefine veriable $token
Make sure you are getting token value in URL - GET token value from URL and save in $token variable .
Fatal error: Call to undefined function random_bytes() in C:\xampp\htdocs\Login_Signu\forgot_process.php on line 15
Kindly tell us which PHP version are you using ?
Use PHP 7.4 VERSION because random_bytes() function was introduce in PHP 7 version.
I do not understand the language you speak I have now finished the design. When I click on the option I forgot my password, I put my email in this message.
The server failed to send the message. Please try again later.
What does that mean teacher
Are you working on localhost ?
The forgot password form will be worked on the live server when you will upload on live server and try it .
@@TechnoSmarter Yes, I am working on a local host. How do I send a message to my email address to change my password?
Try on live server . Upload code on liver server and try it after changing your details in mail function like your from email , web title . It will be worked on Live server definitely . It's tested and working when you will use on live server .
On the live server , the php mail function will work and password link will be sent to the email . You can reset password using that password link .
You can watch demo in the video .
@@TechnoSmarter I didn't understand teacher. 😊 I have absolutely no experience in this field. Please make a video showing how to do this
Bro It Say Sended But I didt recive yet
Configure your mail function . May be some issue . Test mail function first then execute.
Sir php tutorial is very nice but why are you create your website in html
Website is developed on PHP AND MYSQL
.
We use HTML to display data on browser after PHP processed ....
@@TechnoSmarter your page extension is html not a php how can display data from database in html page make a video
You can set any extension like . html .php or without extension using htaccess file .
@@TechnoSmarter sir i am coading in mobile saving file as index.html and running in chrome browser using ksweb app localhost it is showing error exp.
I write html before start tag php and after stop tag php
Bro I Recive mail but can't open token link
Ok. Did you create
password-reset.php page ?
Create
password-reset.php .
Then provide exact
password-reset.php file path in your mail msg with ?token=
That's it .
Change here . Set your reset-password.php path to your site with ?token .
$msg="Your password reset link localhost:8081/php/form/password-reset.php?token=".$token." Reset your password with this link .Click or open in new tab ".$credits."";
@@TechnoSmarter I did but not opening
Make sure session is not set.
Logout account then try .
Provide same path link to your password-reset.php file .
Clear cache and history to destroy session or go to in account page then logout
"The server failed to send the message. Please try again later." how can i fix this
Are you trying on localhost ?
Kindly try on Live server because mail function works on only live server.
Have you started the localhost r not?
Sir Email is not coming 😥
Try mail function works on your server or not .
@@TechnoSmarter registered link has been sent to your email id ye msg display hora liken Registered mail par msg nhi aara.
I m already on 000webhosting server sir .
Use another hosting server to test it . I think manual SMTP is not available in 000webhosting ..
sourcecode please
Go to the reference link in description