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
  • НаукаНаука

Комментарии • 120

  • @TechnoSmarter
    @TechnoSmarter  2 года назад +1

    Update user profile by a session in PHP and MYSQL | Edit Profile image while logged in (Part 3)
    ruclips.net/video/fBfVvUm2N-g/видео.html

  • @I_am_CSR
    @I_am_CSR 3 года назад +4

    Bestest explanations on whole YTube !👍👍👍💖

  • @durgaprasannaacharya6882
    @durgaprasannaacharya6882 2 года назад +1

    Sir,Your channel is just wonderful.It is Amazing

  • @khanturi4987
    @khanturi4987 3 года назад +1

    thnx alot sir....

  • @hellerop1805
    @hellerop1805 3 года назад +1

    Nic

  • @heyswad1590
    @heyswad1590 2 года назад +1

    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!

    • @TechnoSmarter
      @TechnoSmarter  2 года назад

      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 .

    • @heyswad1590
      @heyswad1590 2 года назад

      @@TechnoSmarter i dont know how i missing i typed all your code correctly

    • @TechnoSmarter
      @TechnoSmarter  2 года назад

      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 .

    • @heyswad1590
      @heyswad1590 2 года назад

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

    • @TechnoSmarter
      @TechnoSmarter  2 года назад

      Already told you that you are missing token value from URL . Kindly focus comment above .

  • @Hawk08
    @Hawk08 3 года назад

    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

    • @TechnoSmarter
      @TechnoSmarter  3 года назад

      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

  • @shambhuyadav5239
    @shambhuyadav5239 Год назад +1

    how can we use smtp server not mail function

    • @TechnoSmarter
      @TechnoSmarter  Год назад

      You can use PHPMAILER and host SMTP . Watch it
      ruclips.net/video/fvhQqy6Kang/видео.html

  • @komateswaran2164
    @komateswaran2164 Год назад +1

    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

    • @TechnoSmarter
      @TechnoSmarter  Год назад +1

      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

    • @komateswaran2164
      @komateswaran2164 Год назад

      How to access config.inc.php file

    • @TechnoSmarter
      @TechnoSmarter  Год назад +1

      Check in xampp/phpmyadmin directory.

    • @komateswaran2164
      @komateswaran2164 Год назад

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

    • @TechnoSmarter
      @TechnoSmarter  Год назад

      Uninstall this xampp
      Download latest version
      www.apachefriends.org/download.html
      Install it
      Then try .

  • @shambhuyadav5239
    @shambhuyadav5239 Год назад +1

    how can we use smtp server

    • @TechnoSmarter
      @TechnoSmarter  Год назад

      You can use PHPMAILER and host SMTP . Watch it
      ruclips.net/video/fvhQqy6Kang/видео.html

  • @garenagamingyt2281
    @garenagamingyt2281 2 года назад +1

    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

    • @TechnoSmarter
      @TechnoSmarter  2 года назад

      Are you trying on localhost server ?

    • @garenagamingyt2281
      @garenagamingyt2281 2 года назад

      Sir in comment u mentioned to execute in live sever right?

    • @garenagamingyt2281
      @garenagamingyt2281 2 года назад

      @@TechnoSmarter ss sir

    • @TechnoSmarter
      @TechnoSmarter  2 года назад

      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 .

    • @garenagamingyt2281
      @garenagamingyt2281 2 года назад

      Sir can u make an video for this it will be help for us.. To create

  • @swapnildalimbe8207
    @swapnildalimbe8207 3 года назад

    All is ok but you can send mail because you had used other things like Cpanel and domain racer right?

    • @TechnoSmarter
      @TechnoSmarter  3 года назад

      Mail function will be worked on live server . It's tested and working on live
      server for forgot password .

    • @TechnoSmarter
      @TechnoSmarter  3 года назад

      Yes , I have used cpanel of domain racer .

    • @TechnoSmarter
      @TechnoSmarter  3 года назад

      Use any live cpanel .

  • @jackarmy425
    @jackarmy425 11 месяцев назад

    Sir I am have error in forgot process. Php in that I am facing call to undefined function random _bytes()

    • @TechnoSmarter
      @TechnoSmarter  11 месяцев назад

      Which PHP version are you using?

    • @TechnoSmarter
      @TechnoSmarter  11 месяцев назад

      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

    • @jackarmy425
      @jackarmy425 11 месяцев назад

      How update php version in vs studio

    • @jackarmy425
      @jackarmy425 11 месяцев назад

      Please bro

    • @TechnoSmarter
      @TechnoSmarter  11 месяцев назад

      Code->Preference ->settings
      Look for php version then change it .

  • @aasthaavadhi102
    @aasthaavadhi102 2 года назад

    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.

    • @TechnoSmarter
      @TechnoSmarter  2 года назад

      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/

    • @aasthaavadhi102
      @aasthaavadhi102 2 года назад

      @@TechnoSmarter sir, if i could contact you thru any source? I'm confused🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻

    • @aasthaavadhi102
      @aasthaavadhi102 2 года назад

      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?

    • @TechnoSmarter
      @TechnoSmarter  2 года назад

      Use php mailer classes instead of mail function then use your gmail host to connect online then you can send on localhost.

    • @TechnoSmarter
      @TechnoSmarter  2 года назад

      Yes , you can contact . Social links are available in the description box or search technosmarter on insta or Facebook .

  • @durgaprasannaacharya6882
    @durgaprasannaacharya6882 2 года назад

    • @TechnoSmarter
      @TechnoSmarter  2 года назад

      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

  • @meghananarvekar7565
    @meghananarvekar7565 2 года назад

    Hello sir, I used your source code but when i run password-reset or forgot_password it shows me account page. Pls help me

    • @TechnoSmarter
      @TechnoSmarter  2 года назад

      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 .

  • @totaltechg5606
    @totaltechg5606 2 года назад

    Mera The server failed to send the message problem aa rha hai help

    • @TechnoSmarter
      @TechnoSmarter  2 года назад

      Aap live server par run kar rahe ho ki localhost par ??

  • @KomalMamHere
    @KomalMamHere 3 года назад

    Sir, login page me image nahi load ho rahi logo ki...image.png krke kiya maine.. fir bhi.

    • @TechnoSmarter
      @TechnoSmarter  3 года назад

      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

  • @kajalyadhuvanshi
    @kajalyadhuvanshi 2 года назад

    Fatal error: Call to undefined function random_bytes() in C:\xampp\htdocs\login_preview\forgot_process.php on line 15 plz fix this

    • @TechnoSmarter
      @TechnoSmarter  2 года назад

      What is your PHP version ?

    • @TechnoSmarter
      @TechnoSmarter  2 года назад

      Use PHP 7.4 VERSION because random_bytes() function introduced in PHP 7 .

  • @manimaran-rx4en
    @manimaran-rx4en 2 года назад

    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

    • @TechnoSmarter
      @TechnoSmarter  2 года назад

      I think you are executing on localhost .
      Kindly execute on live server .
      It will work on live server .

    • @manimaran-rx4en
      @manimaran-rx4en 2 года назад

      Ss sir

    • @garenagamingyt2281
      @garenagamingyt2281 2 года назад

      Sir is there is any tutorials u have made for live sever execution purpose?

    • @TechnoSmarter
      @TechnoSmarter  2 года назад

      It's based on live server also you can watch it for mail function .
      ruclips.net/video/I6IR4p0u97c/видео.html

  • @khanturi4987
    @khanturi4987 3 года назад

    it gives error inpassword reset page... line 45 undefine veriable $token

    • @TechnoSmarter
      @TechnoSmarter  3 года назад +1

      Make sure you are getting token value in URL - GET token value from URL and save in $token variable .

  • @relaxingsongsall
    @relaxingsongsall 2 года назад

    Fatal error: Call to undefined function random_bytes() in C:\xampp\htdocs\Login_Signu\forgot_process.php on line 15

    • @TechnoSmarter
      @TechnoSmarter  2 года назад

      Kindly tell us which PHP version are you using ?

    • @TechnoSmarter
      @TechnoSmarter  2 года назад

      Use PHP 7.4 VERSION because random_bytes() function was introduce in PHP 7 version.

  • @user-hz9bl3wi3m
    @user-hz9bl3wi3m 3 года назад

    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

    • @TechnoSmarter
      @TechnoSmarter  3 года назад +1

      Are you working on localhost ?

    • @TechnoSmarter
      @TechnoSmarter  3 года назад

      The forgot password form will be worked on the live server when you will upload on live server and try it .

    • @user-hz9bl3wi3m
      @user-hz9bl3wi3m 3 года назад

      @@TechnoSmarter Yes, I am working on a local host. How do I send a message to my email address to change my password?

    • @TechnoSmarter
      @TechnoSmarter  3 года назад +1

      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 .

    • @user-hz9bl3wi3m
      @user-hz9bl3wi3m 3 года назад

      @@TechnoSmarter I didn't understand teacher. 😊 I have absolutely no experience in this field. Please make a video showing how to do this

  • @relaxingsongsall
    @relaxingsongsall 2 года назад

    Bro It Say Sended But I didt recive yet

    • @TechnoSmarter
      @TechnoSmarter  2 года назад

      Configure your mail function . May be some issue . Test mail function first then execute.

  • @androiddeveloper3222
    @androiddeveloper3222 3 года назад

    Sir php tutorial is very nice but why are you create your website in html

    • @TechnoSmarter
      @TechnoSmarter  3 года назад

      Website is developed on PHP AND MYSQL
      .

    • @TechnoSmarter
      @TechnoSmarter  3 года назад

      We use HTML to display data on browser after PHP processed ....

    • @androiddeveloper3222
      @androiddeveloper3222 3 года назад

      @@TechnoSmarter your page extension is html not a php how can display data from database in html page make a video

    • @TechnoSmarter
      @TechnoSmarter  3 года назад

      You can set any extension like . html .php or without extension using htaccess file .

    • @androiddeveloper3222
      @androiddeveloper3222 3 года назад

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

  • @relaxingsongsall
    @relaxingsongsall 2 года назад

    Bro I Recive mail but can't open token link

    • @TechnoSmarter
      @TechnoSmarter  2 года назад

      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 .

    • @TechnoSmarter
      @TechnoSmarter  2 года назад

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

    • @relaxingsongsall
      @relaxingsongsall 2 года назад

      @@TechnoSmarter I did but not opening

    • @TechnoSmarter
      @TechnoSmarter  2 года назад

      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

  • @jamillyvitoryadasilvabarbo2375
    @jamillyvitoryadasilvabarbo2375 3 года назад

    "The server failed to send the message. Please try again later." how can i fix this

    • @TechnoSmarter
      @TechnoSmarter  3 года назад

      Are you trying on localhost ?

    • @TechnoSmarter
      @TechnoSmarter  3 года назад

      Kindly try on Live server because mail function works on only live server.

    • @KomalMamHere
      @KomalMamHere 3 года назад

      Have you started the localhost r not?

  • @sayyedabrarhusain101
    @sayyedabrarhusain101 3 года назад

    Sir Email is not coming 😥

    • @TechnoSmarter
      @TechnoSmarter  3 года назад +1

      Try mail function works on your server or not .

    • @sayyedabrarhusain101
      @sayyedabrarhusain101 3 года назад

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

    • @TechnoSmarter
      @TechnoSmarter  3 года назад

      Use another hosting server to test it . I think manual SMTP is not available in 000webhosting ..

  • @jomariclaveria8752
    @jomariclaveria8752 3 года назад

    sourcecode please

    • @TechnoSmarter
      @TechnoSmarter  3 года назад

      Go to the reference link in description