Yey another nice tutorial from Senaid. Btw as of PHP7.2 we can use also ARGON2 hashing algorithm. Here is an example: password_hash('hereIsMySecurePassword', PASSWORD_ARGON2I, ['memory_cost' => 2048, 'time_cost' => 4, 'threads' => 3]); note that the options have different keys. ARGON2 works with password_verify() same as PASSWORD_BCRYPT no change needed here but It might became a PASSWORD_DEFAULT as of PHP 7.3 so it is worth knowing that unlike BCRYPT it takes more then 60 char in your MySQL table. So if anyone uses PASSWORD_DEFAULT better update your database column to VARCHAR(255) just for safety.
Thank you! :) I love your comments, they are so informative and I hope that others will read them and learn something from it. Even better, if they go and read more about those extra settings that you're showing here. :)
Very clear explanation. Thanks a lot. I would also suggest removing the token once the link in the email is clicked so that the token can only be used once and must be used before the time limit. Edit: Thanks for the reply, I missed that part. Doh! Very complete and thorough.
thank youuuu so much i got my phpmailer working because of you. i have been seeing many videos working but none of them i coundnt get now i got it thanks a lottttttttttttttttttttttttttttttttttttttttttt
Hello, Senaid! I'm not usually one to comment on RUclips videos, but I wanted to let you know that the work you're doing is incredible! I've taken advantage of the Black Friday special and I'm hoping someone will get back to me soon with username and password so I can start coding with you some more!
Hey Catilin, thank you so much for nice words, and also for purchase of Web Development Accelerator. All login details have been sent, and I can see that the one for you has been sent on 29.11.2018, so please make sure that you check your inbox/spam folder again. If you still have any problem, feel free to reach out again and I will make sure that you get those.
Hello Senaid, I'm from Brazil, country located on South America, a tropical country. I would like to thank you for your great videos. If you come to Brazil, please let me know, I'll be glad to guide you. Best Regards, Antonio Josa.
@@SenaidBacinovic Do you have a tutorial on how to use and integrate Progressive Web App / PWA using bootstrap or in a system like in a admin panel ? Thanks in advance :D
Damn I'm so glad I've found your channel couple months ago. You make everything look so much easier. And your teaching skills are on point as well. So thank you very very much Senaid. Hope you are allright and you will continue filming tutorials for us - the brand-new web developers. Cheers
Hi Senaid, I really like this video. Although there is a suggestion I can give you about generating random numbers for the token. The way you made token numbers is good, but a better way to get random numbers for the token would be to get the the user email, and attach it with the timestamp of when the "request password" button was clicked, and then put it in a sha1 or str_suffle function, so that way you don't have to write any random numbers..php will automatically create very unique encrypted random numbers based on the date and time the request was made. Thanks Love your videos
Thank you for the suggestion. There are so many different, and much better ways on how to do it, but I guess the entire purpose of this video is not that, so I just decided to show quick simple way on how to do it manually, so that viewers learn that too.
@@taps09099 i translated whole thing to turkish i dont think you would understand a word of it bro, do it over and over it works trust me i wasted 2 days over it..
if you already have a user database for a social network site, do you create a new table for this or add the token and token expire to current database?
Thanks a lot for your amazing videos Senaid we hope you start with tutorials about AngularJs on your way of teaching cuz I'm still so confuse about it and I want to use it in new future projects :)
Nice video... One criticism I have for your tutorials is that if you make the HTML and CSS (bootstrap) skeleton before recording video you can greatly reduce video length. I am talking about in general not for this specific video. And are you going to make tutorials on other web technology stacks? Keep it up man.. !!
Raj yeah, I can save a lot of time, but I remember that back in a day when I started I always hated when I see tutorial with a lot of the code where 80% is not explained, and that is reason why I started this RUclips channel and explain everything in details. Also, for those that don't need to see how to create design, they can easy skip that part, while others can see everything explained. :)
Should you not encrypt also the e-mail when receiving the e-mail ? Suppose youre not using HTTPS and email can get spoofed with a man-in-the-middle on a shared wifi.
Coding Passive Income, When you set the database token equal to ' ', you allow anyone to access the reset password page. A user can access it with a url and have parameters of token = ' ' and any email of their choosing. The database would also give them a match and then expose a new password to them. The problem arises because of the isset( ). The isset( ) function returns true on token = ' '. Maybe the empty( ) function might work to validate the GET inputs.
Hey Samuel, I appreciate your comment and detail explanation about the problem that you have found. However, if you check the SQL query down below, you can see that I am also checking for " token '' ", which means that we are not allowing someone to change the password if token is empty. :)
Fairly good tutorial although a few things in php have changed since this video so not everything worked right of the bat. E.g. Substr doesn’t use the ‘start:’ or ‘length:’ words, it just needed the values.
Thank you! Well, substr() never needed those "start or length", basically that's just added by PHPStorm that I am using to make my work easier (so that I know what are the parameters for the function), and you shouldn't write that in the code.
Hello Mr. Senaid, great job sir. I am having problem though sending the mail out, whenever I click the reset button, I keep getting this error note: 'Something Wrong Just Happened! Please try again!'. I tried echoing '$mail->ErrorInfo' and the output was "Could not instantiate mail function." please help!
Very informative tutorial sir. I just noticed that after a user reset his password, the password table is long and different to the given new password. Will it still log-in with your credentials? Btw, im just starting to learn php so no @ Thank you so much sir. Godbless
Thank you so much sir. I was also working for the same system and it works on phpmailer. But just a thing in my work, after a user change his password, they credentials they input are invalid. Btw, i didnt used tokens, does it matter? Thank you again for response sir.
As long as you use same encryption method for your password and store it in the database, it should work. It's very hard for me to tell what exactly is the problem until I really see your code. Can you show me here your login and resetPassword code?
Nevermind sir. I'll just do it your way. I think your method is quite easier than mine. Btw, this video is a great tutorial for me as a beginner sir. Thank you for continuous reply on my inquiry. More subs coming ♥
Sir, having the password display in browser is bad security practice, people might be able to see it, is there a way that I can get the password to show in email instead please sir?
good sir, i need help, i kept fail to send the email eventhough i'm using both valid email, what should i do? iwas there any setup to connect the email or anything? thank you
sir id like to know where can i get the rest of the videos since i dont even know the database membershipsystem came from how was it created the whole login setup please and thank you
In this video, I do not talk about membership system, and I assume that you already have some login system in place, but if you don't just watch some of my videos on this channel on how to create one. :)
Salma - please check your console log, there has to be some error. Keaikitse - I am not obligated to answer, and still I answer 99% of comments, but yes, it takes time for me to answer all of them since I run 2 companies and do RUclips thing in my free time, and on average get about 40 comments each day + emails. ;)
i have just copied your files, made no mistake at all. changed mysqli user name password and database name correctly. no error. but eventually my reset password button is not working at all. its doing nothing, what is the problem i dont know.. i have wasted 4 hour to find out the problem but i could not. please suggest me what should i do
in forgotPassword.php file at the js script change this $(document).ready(function () { $('.btn primary').on('click', function () { TO $(document).ready(function () { $('.btn').on('click', function () { the only change i made was removing .btn primary to only .btn So try it i had similar issue
Hello, i have a problem. When i use the Mailer i got a blank screen without errors. I enabled error reporting but nothing happens. use PHPMailer\PHPMailer\PHPMailer; require_once "phpmailer/PHPMailer.php"; require_once "phpmailer/Exceptions.php"; When i delete these lines, the page loads fully. Can u help me?
Please help i get this error when i click the forgot password button {"status":0,"msg":"Something Wrong Just Happened! Please try again!!"} Im sure i did the procedure right and the codes. I dont know where i did wrong. The database's token and token expire where updated but no message was sent to my email and get the error instead. Please help!
Hi sir. Why am i getting the msg "Something wrong just happened", and not when the status =1? i used your code and just change the code according to my database.
when i click reset password...nothing work,gives no error but page still same. and i am linking this forget functionality to login authentication with email verification,which you had made earlier all the php page is working but this forgetpassword page is not working...help me
@@SenaidBacinovic k, thank you sir, I was able to add it, but I am wondering if i can get password to show in email bc if password show in browser it would be bad practice, do you have any code suggestions?
somehow even with source code it doesn't work for me it doesn't show the error messages or the success messages and i don't get a email but atleast i get the token and tokenExpire in my database
I'm using your source code, but I keep getting bounced back to the login page after clicking on the email link. I've verified that I am connected to the mysql database correctly, the token is being generated, and the token in the database matches the token in the email link. I am not getting any error messages on the site or in the error log. I believe I've narrowed the issue down to this bit of code: if ($sql->num_rows > 0) { $newPassword = generateNewString(); $newPasswordEncrypted = password_hash($newPassword, PASSWORD_BCRYPT); $conn->query("UPDATE users SET token='', password = '$newPasswordEncrypted' WHERE email='$email' "); echo "Your new password is $newPasswordClick here to log in"; } else redirectToLoginPage(); I'm not sure what's causing the redirect. Can you tell me how can I troubleshoot this issue?
There are no issues with the conditional wrapping. After a lot of experimentation I've made some progress, though I am still not able to login after resetting the password. I've been able to get past the original issue by deleting "AND tokenExpire > NOW()" from resetPassword.php. I assume that issue is being caused by the set up of the tokenExpire column in the database, though I'm not sure how since there's no info about this in the video. The new issue is this: Clicking on the reset password link in the email takes me to the "Your New Password Is *******, Click Here To Log In" page, but when I copy and paste the new password into the log in page I get an error (Login failed. User or password is incorrect.), and am unable to log in. Something seems to be going wrong with the password encryption. Once again, I'm looking at the bit of code I posted originally. This is really frustrating. Any guidance would be appreciated.
I believe that you have an error in the last SQL query where we need to update the password in the database. Can you make sure that password is actually changed in the database?
Hi. Great tutorial CPI. Thanks. I'm having a problem where after I press the link which is sent to my email account, I get sent to a page displaying the following error - This page isn’t working. website.com is currently unable to handle this request. HTTP ERROR 500 Anybody else experience this? I'm running on my live server and I can see the DB is populated. Many thanks.
Why on earth does this require jQuery? I mean why add to the complexity when you can call myql from PHP without it? Now I have more to learn than I want if I try to use this code. Also, I have a busy chat site and the pages are refreshed several times per minute, per customer. Loading a big library every click is not good for bandwidth, which is still not free. In a tutorial that has usable source code, you really need to avoid piling on the newbies.
Hey Gary, I am sorry to hear that you didn't like the jQuery part, but obviously this tutorial is for learning purposes and I am trying to explain as many things as possible and to still create useful solution. Also, loading few extra KB is better than to have load entire page again on each form submit.
Just an update - my problem was that I wasn't using the correct name for my table (doh!) . I am now getting a new password on my screen (however - that password is currently not working. I'll update this comment why I find out what I'm doing wrong.
Dexter The goal of this video was to show most important things how to do, and if you understand this it is easy to just show form to set new password or do anything else that current coder thinks is the best experience for customer. In all of my videos I am trying to give the best possible explanation for the problem that tutorial is fixing, so that is reason why I didn't do that, but great suggestion. Thank you.
Hi, when i click reset password, nothing works. It gives me no errors it just stays on the same page. I have also checked the source code and can't seem to figure it out. Can someone help please?
Yey another nice tutorial from Senaid.
Btw as of PHP7.2 we can use also ARGON2 hashing algorithm. Here is an example:
password_hash('hereIsMySecurePassword', PASSWORD_ARGON2I, ['memory_cost' => 2048, 'time_cost' => 4, 'threads' => 3]);
note that the options have different keys.
ARGON2 works with password_verify() same as PASSWORD_BCRYPT no change needed here but
It might became a PASSWORD_DEFAULT as of PHP 7.3 so it is worth knowing that unlike BCRYPT it takes more then 60 char in your MySQL table. So if anyone uses PASSWORD_DEFAULT
better update your database column to VARCHAR(255) just for safety.
Thank you! :)
I love your comments, they are so informative and I hope that others will read them and learn something from it. Even better, if they go and read more about those extra settings that you're showing here. :)
Very clear explanation. Thanks a lot.
I would also suggest removing the token once the link in the email is clicked so that the token can only be used once and must be used before the time limit.
Edit: Thanks for the reply, I missed that part. Doh! Very complete and thorough.
Thank you. Yes, I agree with you, token should be reset once we use it, and that is what I am showing at 35:10
Never see such this kind of explanation even from my professor...no words to say Mr. Senaid
thank you :)
thank youuuu so much i got my phpmailer working because of you.
i have been seeing many videos working but none of them i coundnt get now i got it thanks a lottttttttttttttttttttttttttttttttttttttttttt
Hello, Senaid! I'm not usually one to comment on RUclips videos, but I wanted to let you know that the work you're doing is incredible! I've taken advantage of the Black Friday special and I'm hoping someone will get back to me soon with username and password so I can start coding with you some more!
Hey Catilin, thank you so much for nice words, and also for purchase of Web Development Accelerator.
All login details have been sent, and I can see that the one for you has been sent on 29.11.2018, so please make sure that you check your inbox/spam folder again. If you still have any problem, feel free to reach out again and I will make sure that you get those.
Hello Senaid,
I'm from Brazil, country located on South America, a tropical country.
I would like to thank you for your great videos.
If you come to Brazil, please let me know, I'll be glad to guide you.
Best Regards,
Antonio Josa.
Thank you so much, that is really an amazing offer, will keep it in mind!
Demn... thank you because i never saw a tutorial like this very informative and easy to understand your tuts are beginner friendly like me
Thank you :)
@@SenaidBacinovic why not reply to our comments
@@keaikitse are you sure? :)
@@SenaidBacinovic yes you only reply to people who says thank you
@@SenaidBacinovic Do you have a tutorial on how to use and integrate Progressive Web App / PWA using bootstrap or in a system like in a admin panel ? Thanks in advance :D
heya Senaid, thank you for your videos. always straight to the point and very informative...
This channel is perfect...♥️
thank you :)
Damn I'm so glad I've found your channel couple months ago. You make everything look so much easier. And your teaching skills are on point as well. So thank you very very much Senaid. Hope you are allright and you will continue filming tutorials for us - the brand-new web developers. Cheers
Thank you so much for the nice words. I will, for sure, soon!
man you are legend.
Hi Senaid, I really like this video. Although there is a suggestion I can give you about generating random numbers for the token. The way you made token numbers is good, but a better way to get random numbers for the token would be to get the the user email, and attach it with the timestamp of when the "request password" button was clicked, and then put it in a sha1 or str_suffle function, so that way you don't have to write any random numbers..php will automatically create very unique encrypted random numbers based on the date and time the request was made.
Thanks
Love your videos
Thank you for the suggestion. There are so many different, and much better ways on how to do it, but I guess the entire purpose of this video is not that, so I just decided to show quick simple way on how to do it manually, so that viewers learn that too.
Another great tutorial
arif hussain thank you :)
I love to watch all video. Thank you so much for making great videos
Abhishek Kumar thank you :)
thanks alot man even tho 3 years later still helpfull..
its working ??
@@taps09099 its working
Can i get the source code
@@taps09099 i translated whole thing to turkish i dont think you would understand a word of it bro, do it over and over it works trust me i wasted 2 days over it..
Glad it helped
thank you, keep up the good work you are the best
thank you :)
if you already have a user database for a social network site, do you create a new table for this or add the token and token expire to current database?
Braiden Mincey just add missing columns, there is no need for a new table :)
Hello bro, can u show us, how to write a php installer for CMS?
that's a very good tutorial...thanks :)
thank you
Plz make a video on letting user to choose the new password, Great work again!
Will do, thank you! :)
thank you sir such an wonderful explanation :D
thank you, glad I could help!
Thanks a lot for your amazing videos Senaid
we hope you start with tutorials about AngularJs on your way of teaching cuz I'm still so confuse about it and I want to use it in new future projects
:)
Thank you! I will definitely have some tutorials about Angular/React/Laravel. :)
thank you so much
My pleasure, thank you :)
Thank you so much sir!
Thank you :)
Thank you so much for your explanation but what is your data_type for token and tokenExpire sir?
My pleasure. If I remember correctly, token is VARCHAR(20), and tokenExpire is DATETIME
Very clear explanation, thanks Mr. Senaid
Would you create tutorial about codeigniter? because that's very interesting topic to discuss
Thank you. I will have some tutorials in the future :)
Very good! but there are not a PDO version ?
No, I do not use PDO often.
So good, clear, and informative! Thank you man.. keep it up.
thank you! :)
Nice video, continue your excelent job :D
Thank you, will do! :D
excellent, helpful !
New tutorial 😍
Isuru Karunarathna :)
Thank you bro
thank you!
you are awesome!
exelint sir tnq
Nice video... One criticism I have for your tutorials is that if you make the HTML and CSS (bootstrap) skeleton before recording video you can greatly reduce video length. I am talking about in general not for this specific video. And are you going to make tutorials on other web technology stacks? Keep it up man.. !!
Raj Thank you! Yes, absolutely. :)
Coding Passive Income I have edited the comment if you want to read. :)
Raj yeah, I can save a lot of time, but I remember that back in a day when I started I always hated when I see tutorial with a lot of the code where 80% is not explained, and that is reason why I started this RUclips channel and explain everything in details.
Also, for those that don't need to see how to create design, they can easy skip that part, while others can see everything explained. :)
Coding Passive Income ok Cool :)
What if you want to update your password to a new password using forms.. how can you do it
Bring more videos on Php . maybe an ecommece if you get enough time .
Absolutely, I have already planned to show how to create entire eCommerce system. :)
that would be cool , i will wait !
thank you!
Should you not encrypt also the e-mail when receiving the e-mail ? Suppose youre not using HTTPS and email can get spoofed with a man-in-the-middle on a shared wifi.
Coding Passive Income,
When you set the database token equal to ' ', you allow anyone to access the reset password page. A user can access it with a url and have parameters of token = ' ' and any email of their choosing. The database would also give them a match and then expose a new password to them. The problem arises because of the isset( ). The isset( ) function returns true on token = ' '. Maybe the empty( ) function might work to validate the GET inputs.
Hey Samuel, I appreciate your comment and detail explanation about the problem that you have found. However, if you check the SQL query down below, you can see that I am also checking for " token '' ", which means that we are not allowing someone to change the password if token is empty. :)
@@SenaidBacinovic,
You're right bro. Good videos by the way
Thank you!
Fairly good tutorial although a few things in php have changed since this video so not everything worked right of the bat. E.g. Substr doesn’t use the ‘start:’ or ‘length:’ words, it just needed the values.
Thank you! Well, substr() never needed those "start or length", basically that's just added by PHPStorm that I am using to make my work easier (so that I know what are the parameters for the function), and you shouldn't write that in the code.
can you provide details of Adminer values of password,token,& token expire the name I know ID its an int type with 13length
Password - varchar 255
Token - varchar 20
TokenExpire - datetime
Thanks ♥
very cool!
thank you :)
I was expecting to see video on php composer how long will I have to wait for it bro?
a.v web studio I will give my best to publish it next week, sounds good?
Gracias!!!
Hi!! I am using MACOS. Is the PHPMailer compatible with it??? I am not receiving any email :(
Hello Mr. Senaid, great job sir.
I am having problem though sending the mail out, whenever I click the reset button, I keep getting this error note: 'Something Wrong Just Happened! Please try again!'. I tried echoing '$mail->ErrorInfo' and the output was "Could not instantiate mail function." please help!
Very informative tutorial sir. I just noticed that after a user reset his password, the password table is long and different to the given new password.
Will it still log-in with your credentials?
Btw, im just starting to learn php so no @
Thank you so much sir. Godbless
In database*
If you created the same way I did it, it should work. The string in database is encrypted, so make sure that it doesn't confuse you.
Thank you so much sir.
I was also working for the same system and it works on phpmailer. But just a thing in my work, after a user change his password, they credentials they input are invalid.
Btw, i didnt used tokens, does it matter?
Thank you again for response sir.
As long as you use same encryption method for your password and store it in the database, it should work. It's very hard for me to tell what exactly is the problem until I really see your code. Can you show me here your login and resetPassword code?
Nevermind sir. I'll just do it your way. I think your method is quite easier than mine.
Btw, this video is a great tutorial for me as a beginner sir. Thank you for continuous reply on my inquiry. More subs coming ♥
Sir, having the password display in browser is bad security practice, people might be able to see it, is there a way that I can get the password to show in email instead please sir?
it also doesn't show the messages such as please check your inputs etc. I'm confused I don't know where I went wrong
Did you figure this out bro? I have the same problem
good sir, i need help, i kept fail to send the email eventhough i'm using both valid email, what should i do? iwas there any setup to connect the email or anything? thank you
sir,what would be my domain name for this example if i am using Xampp for this example?
You can use your IP address OR even better watch my tutorial where I am showing how to use NGROK.
sir id like to know where can i get the rest of the videos since i dont even know the database membershipsystem came from how was it created the whole login setup please and thank you
In this video, I do not talk about membership system, and I assume that you already have some login system in place, but if you don't just watch some of my videos on this channel on how to create one. :)
Thank you senaid ill download all the videos from the beginning ive managed to sort out the error
can you make video on forgot password system using token and user itself create or reset his/her password.
Sir how about coding on register user? What shoud i declare about token and token expire?
hi can i use localhost to do this? or do i need server
Yes, you can use localhost, but make sure that there isn't something that is blocking email sending.
should i put all this under a form. My button is not working
Hello, I have followed every code but whenever I hit "reset password" nothing happens
down vote his video for not replying
Salma - please check your console log, there has to be some error.
Keaikitse - I am not obligated to answer, and still I answer 99% of comments, but yes, it takes time for me to answer all of them since I run 2 companies and do RUclips thing in my free time, and on average get about 40 comments each day + emails. ;)
Should make a tutorial with PDO
i have just copied your files, made no mistake at all. changed mysqli user name password and database name correctly. no error. but eventually my reset password button is not working at all. its doing nothing, what is the problem i dont know.. i have wasted 4 hour to find out the problem but i could not. please suggest me what should i do
in forgotPassword.php file at the js script change this $(document).ready(function () {
$('.btn primary').on('click', function () { TO $(document).ready(function () {
$('.btn').on('click', function () {
the only change i made was removing .btn primary to only .btn
So try it i had similar issue
Hello, i have a problem. When i use the Mailer i got a blank screen without errors. I enabled error reporting but nothing happens.
use PHPMailer\PHPMailer\PHPMailer;
require_once "phpmailer/PHPMailer.php";
require_once "phpmailer/Exceptions.php";
When i delete these lines, the page loads fully. Can u help me?
Do you have those files in "phpmailer" folder?
Please help i get this error when i click the forgot password button
{"status":0,"msg":"Something Wrong Just Happened! Please try again!!"}
Im sure i did the procedure right and the codes. I dont know where i did wrong.
The database's token and token expire where updated but no message was sent to my email and get the error instead. Please help!
Have you done any investigation why email sending failed? Are you sending an email from localhost?
hello sir everybody doesn't own a domain so what should they do
Keeps on echoing "Something wrong just happened, Please try again!". Please help me. I am using localhost.
Where do you put the password of the email address that's supposed to send the email from? :O
cool, i need a tutorial on forgot password without sending a confirmation link to the email. thanks
So, how you will verify that someone is not trying to scam you?
Hi sir. Why am i getting the msg "Something wrong just happened", and not when the status =1? i used your code and just change the code according to my database.
please somebody help me. I have to complete this ASAP.
Where do you get that problem?
@@SenaidBacinovic when i enter the email to reset password, at the forgotPassword.php
@@intanhafizah9564 please fill for mail $mail->setFrom("your sender mail", "name");
what is the type of "tokenExpire" colomn in DB??
DATETIME
when i click reset password...nothing work,gives no error but page still same.
and i am linking this forget functionality to login authentication with email verification,which you had made earlier
all the php page is working but this forgetpassword page is not working...help me
have you gotten answer for this?
Your link to the source code doesn't work for me, any alternatives?
What the database strructure like tokenExpired(date/varchar/etc)
this guy is cheating , I asked same question long time ago and he only reply to people who says thank you, that havent tested this
I have website created with php..but still no visitor? Why?
How to set phpmailer in windows php sublime? Please reply
Senaid pls can you show how to do this with form
Hello sir, can this work for sign up and log in system from comment system with reply?
Yes, it should work with (I guess) small modifications (like database/table/columns etc)
@@SenaidBacinovic k, thank you sir, I was able to add it, but I am wondering if i can get password to show in email bc if password show in browser it would be bad practice, do you have any code suggestions?
Yes, that is bad practice in most cases. Just watch any of my "PHPMailer" tutorials, and instead of showing the password, just send an email. :)
@@SenaidBacinovic great thank you sir :D! if you are available do you think you can help me with the comment and reply system sir?
@@SenaidBacinovic Also, when I get to the PHPMailer tutorial, do I implement the code into resetPassword.php
(Something Wrong Just Happened! Please try again!) error it shows how can is solve it sir.what may be error
are you running on a localhost?
@@olisakweifeanyi4996 I have the same problem and I 'm running on localhost
@@sharwansoekhoe8023 You have to set up your PHP Mailer to function well on your local Host...Or Kindly Put on a Live Server
somehow even with source code it doesn't work for me it doesn't show the error messages or the success messages and i don't get a email but atleast i get the token and tokenExpire in my database
hello from algeria my friend please have you a method for crypt the password i use md5 but i want like same XA6AG...... please help
I would suggest this method:
ruclips.net/video/3bGDe0rbImY/видео.html
thank you our professor
hakim souhily thank you :)
I'm using your source code, but I keep getting bounced back to the login page after clicking on the email link. I've verified that I am connected to the mysql database correctly, the token is being generated, and the token in the database matches the token in the email link. I am not getting any error messages on the site or in the error log. I believe I've narrowed the issue down to this bit of code:
if ($sql->num_rows > 0) {
$newPassword = generateNewString();
$newPasswordEncrypted = password_hash($newPassword, PASSWORD_BCRYPT);
$conn->query("UPDATE users SET token='', password = '$newPasswordEncrypted'
WHERE email='$email'
");
echo "Your new password is $newPasswordClick here to log in";
} else
redirectToLoginPage();
I'm not sure what's causing the redirect. Can you tell me how can I troubleshoot this issue?
please check conditional wrapping this if. There could be some problems in $_GET[' ']
There are no issues with the conditional wrapping.
After a lot of experimentation I've made some progress, though I am still not able to login after resetting the password. I've been able to get past the original issue by deleting "AND tokenExpire > NOW()" from resetPassword.php. I assume that issue is being caused by the set up of the tokenExpire column in the database, though I'm not sure how since there's no info about this in the video.
The new issue is this: Clicking on the reset password link in the email takes me to the "Your New Password Is *******, Click Here To Log In" page, but when I copy and paste the new password into the log in page I get an error (Login failed. User or password is incorrect.), and am unable to log in. Something seems to be going wrong with the password encryption. Once again, I'm looking at the bit of code I posted originally.
This is really frustrating. Any guidance would be appreciated.
I believe that you have an error in the last SQL query where we need to update the password in the database. Can you make sure that password is actually changed in the database?
Seniad it says something wrong just happen whAT error do i have right now?
Have you tried to investigate more why do you get that problem?
what is the name of your code editor
PHPStorm :)
sir can u guide me to how to create that databse plss??
Hi, when i click reset password,it gives me error "Something Wrong Just Happened! Please try again!", where is the problem? plz help.
When is that happening?
I have the same problem... The token is is created and updated, but the email is not sent
me too :"(
hello Senaid ,
Your explanation is wonderful
can you tell me is that possible to use this code for localhost xampp
how?
Hi. Great tutorial CPI. Thanks. I'm having a problem where after I press the link which is sent to my email account, I get sent to a page displaying the following error - This page isn’t working. website.com is currently unable to handle this request. HTTP ERROR 500
Anybody else experience this? I'm running on my live server and I can see the DB is populated.
Many thanks.
Hey I'm getting the same problem. What is the reason?
I have try this code and get "Something wrong" message and do not receive any email. Can you help please?
Instead of:
echo "Something Wrong"
try
echo $mail->ErrorInfo
and see the reason why it fails.
@@SenaidBacinovic I got this -> 'Could not instantiate mail function.'
I have one question.How can we learn from the start about html,css and php
Does anyone have the source code for this please? None of the links work properly, they all just go to the channel's RUclips page or to another video
Check the link now.
@@SenaidBacinovic thanks dude, much appreciated 👍
Please where is the database ? :) thank you in advance..
My problem is not updated password and also token is not empty as in last step.
Check your SQL query, there has to be something wrong.
sir what are the data types of id , name , email, token & tokesn expire
?????????????????????????????
lets dislike for not replying
no errors and no output, what may be the problem sir, plz reply
What is the difference between my and your code?
source code is incomplete I dont see any php mailer or Json files
Why on earth does this require jQuery? I mean why add to the complexity when you can call myql from PHP without it? Now I have more to learn than I want if I try to use this code. Also, I have a busy chat site and the pages are refreshed several times per minute, per customer. Loading a big library every click is not good for bandwidth, which is still not free.
In a tutorial that has usable source code, you really need to avoid piling on the newbies.
Hey Gary, I am sorry to hear that you didn't like the jQuery part, but obviously this tutorial is for learning purposes and I am trying to explain as many things as possible and to still create useful solution.
Also, loading few extra KB is better than to have load entire page again on each form submit.
I copied source code and its not working . No erros no movement just freezed content
I guess people can just bruteforce the token . They can try every combination and the duration would be short because the token is small
It's important to learn the concept. The easy thing is to make longer token. :)
@@SenaidBacinovic alright :}
Just an update - my problem was that I wasn't using the correct name for my table (doh!) . I am now getting a new password on my screen (however - that password is currently not working. I'll update this comment why I find out what I'm doing wrong.
pls need data base proyect.
Why are you not allowing the user to set his own password?
Dexter The goal of this video was to show most important things how to do, and if you understand this it is easy to just show form to set new password or do anything else that current coder thinks is the best experience for customer.
In all of my videos I am trying to give the best possible explanation for the problem that tutorial is fixing, so that is reason why I didn't do that, but great suggestion. Thank you.
Something Wrong Just Happened! Please try again!
could you tell me what i m missing.
thanks!
Instead of that message, try to put $mail->ErrorInfo and see what will happen.
token number not showing in database
what happened here?
have the same problem it says: Could not instantiate mail function. when i echo $mail->ErrorInfo;
Hi, when i click reset password, nothing works. It gives me no errors it just stays on the same page. I have also checked the source code and can't seem to figure it out. Can someone help please?
What is the error?