Lesson Code: http://www.developphp.com/video/PHP/Forgot-Account-Password-Form-Email-Script-Ajax-Tutorial Learn to program an Ajax PHP MySQL Forgot …
Original source
Lesson Code: http://www.developphp.com/video/PHP/Forgot-Account-Password-Form-Email-Script-Ajax-Tutorial Learn to program an Ajax PHP MySQL Forgot …
Original source
34 responses to “9. Forgot Account Password Form Email Script Ajax PHP MySQL Tutorial”
Very Nice Tutorials Mr. Adams K thanks a lot..
hi adam I have problem with login.
this spell.
Notice: Undefined variable: db_conx in C:xampphtdocschatuser.php on line 19
Warning: mysqli_query() expects parameter 1 to be mysqli, null given in C:xampphtdocschatuser.php on line 19
Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, null given in C:xampphtdocschatuser.php on line 21
Good tutorial but I would advise against telling them when they get a wrong email. Otherwise people could use this system to find out what emails are on the system, and which ones are valid and not valid. It helps the hackers. Best to give a message to say the email has been sent, but not give away if the email is really on the system.
I copy/pasted everything into a new .php-file named "forgot_pass.php".
I changed the sql strings and such to fit my exact tables .. however, when I click the button "genere tem log in password" nothing happens at all.
What do I do?
Also, how do I connect to my very own Database? I see db_conx but I'm not sure what to do with it.
I have a dbconnect.php file, where I can connect to my DB. How do I implement it?
hello adam i am getting an message unknown error occur when pressing the generate button.. what might be the problem? can any one help," but the mail is sent by the system…"
Works perfectly till now. only problem is receiving the emails but I understand it is due to the SMTP not being available on my localhost. but soon i will migrate to a hosting service. and hopefully everything works fine.
Wanted to say that you rock Adam! Thank you so much!
for me the unknown error was caused by having the page named /forgot_password.php and not /forgot_pass.php
It fixed all my errors. I guess my mind defaulted to naming it the way I did.
But how to open the first program? Somebody please help me.
Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result
Warning: Cannot modify header information – headers already sent by (line 56-58)
Thanks for the tutorial Adam.
+Adam Khoury I cannot get this to even begin doing anything. I created the useroptions table. I want to note this first as I am not sure if it is causing this. I put all of your code into my file name called forgotpassword.php. I modified all of your code to reflect that. I did not put your <script src="js/main.js"></script>
<script src="js/ajax.js"></script> files in mine as I am not sure what those contain or where to locate them. It seems like my issue starts right from the beginning. I enter the email adress and then click the generate temporary password button and nothing happens at all. What would be causing this??
It's weird because Google put an add about dogs in the beginning of the video, and then he said what;'s up doggies.
thanks for the feature, this is SUPER handy for those lazy or forgetful people
Man I am about to giving up on this page. I keep on getting no where with it. Now I get the link on my email but when I click on it. It gives me the error messages there is no match for that user and temporary password. Can anyone help
Thank you for all your informative lessons. learned a lot!
Adam Khoury,
Just wanted to say thanks for the videos, I've learned a lot by following along your series.
I am having a issue with this code however. I've gone through the code line by line and I'm pretty sure I understand it however for some reason when I click on the Generate temporary password button all I get is please wait. It never goes any further. I never have a temporary password created in my db. Some assistance would be greatly appreciated.
Works perfect ! 🙂
Can somebody tell me why do i get error when i try to connect to the page ? it's saysLogin unsuccessful, please try again.
I dont receive the Temporary Password email, even though i get 'success' (Step 2. Check your email inbox in a few minutes You can close this window or tab if you like.) when i click the button. I checked the code but everything it seems to be ok. btw I do receive activation email sent by signup.php and i copied the mail structure from that and i paste it in my file but still doesnt work. can anyone help me?
where are the main.js and ajax.js files??
where did you learn this, i cant seem to find anyone to teach me php. i am in london now and the only college thats teachs php, only teaches for 4 weeks 2 hours every week, but i want to learn php so please tell me how you knew to play with php as good as u do. did u get taught and where please
Thanks Adam, it works perfect! Just one little thing I'd change or improve would be, when you enter a non-existing email, you get the status "Sorry that email address is not in our system", and the "Generate Temporary Log In Password" BUTTON disappears, but it doesn't come back. It may confuse the user. So I added:
_("forgotpassbtn").style.display = "block";
Before:
_("status").innerHTML = "Sorry that email address is not in our system";
So it shows the error message, and the submit button too.
You Rock Adam!!!
I click on the "generate temp password" and it does nothing…..what's up with that?
I've got the same problem: "Unknown Error has occured". I also receive an e-mail with temp pass but the link to activate temp_pass as a main password doesn't open. Anybody knows how to fix it?
I'm getting the "Unknown Error has occured" too. Although the temp password gets created and the email link swaps the password just fine. Anyone know what might be the problem?
Really enjoying these tutorials Adam… learning tons from ya dude. Thank you very much for putting this video series together.
Adam, you the best out of the rest. Thanks for all your tutorial series.
Hi Adam, thanks so much for this tutorial series! I now encountered the same problem as Ayush Sharma: "after I have click the email link of temporary password , it tells login unsuccessful, with new password but I can login with my old password". I checked in mysql myadmin that the temp pass is successfully generated in the useroptions table, and successfully gets deleted upon clicking the email link, however the original password from users table remains and does not get "overwritten" … please help? Thanks so much!
Hi Adam can you help me to create a change password system connecting to this tutorials.. thanks 🙂
For those having problems when being redirected from the email to forgot_pass.php [i.e. the page remains blanck not redirecting to login.php]: I made a separated forgot_pass_activation.php to process the temporary password activation. It seems to have solved the problem. (I copied the entire code for // EMAIL LINK CLICK CALLS THIS CODE TO EXECUTE in the forgot_pass_activation.php and updated the link in the $msg variable ). 🙂
woah. a few years ago i was looking at code while inspecting an element. It made no sense. I thought the symbols and letters had no meaning. Now, after beginning to learn code it all clicks in. It makes so much sense. Code is so so so cool i feel like i could spend hours and hours and days just making a website… 😀
Refer to video 7
I am guessing in your signup page, you still have the password being encrypted with crypt. he changes it to md5 in this video so make sure you change it as well.