I got your problem in the middle of the video. I guess you already found out, but if not: password_hash is different and much better than other hashing functions, because its *salted*. but therefore, to login you have to use password_verify($password, $hashed_password). $arr['email'] = $data['email']; $query = "select * from users where email = :email limit 1"; $row = database_run($query, $arr); if(is_array($row)){ $hash = $row[0]->password; if(password_verify($data['password'], $hash)) { $_SESSION['USER'] = $row; $_SESSION['LOGGED_IN'] = true; Thank you so much for everything!! I love your videos and I am learning a lot from them!
I would like to add a question: Why do you prefer working with $redirect at 60min of the video? Why not this shorter and simplier way: function check_login(){ if(isset($_SESSION['USER']) && isset($_SESSION['LOGGED_IN'])){ return true; }else{ header("Location: login.php"); die; }
This looks like it is object oriented using PDO whereas I have been learning functional with mysql. What I have taken from this is PDO can still use mysql statements as I was under the impression PDO was an entirely different storage facility. You should have stated this in your title as people like me may not want to waste 2 hours getting confused, but there was still a learning experience just the same. Thank you for another eye opener. I guess now I have to learn the difference between object oriented vs functional. I have to stick with functional as this is the path I chosen. I will be able to incorporate this into my already existing system with a few tweaks. Thumbs Up!
glad you learnt something. PDO doesnt necessarily mean object oriented though. it can be used in procedural programming just as well. PDO is simply a universal way to connect to different databases. thats its primary job. it makes it easier to change database types at any time without having to change much of your code. it also works very well with prepared statements and thats why i prefer it. but i would encourage you to learn OOP. i have an entire playlist on my channel. OOP makes your code more scalable. i cant imagine building a large website without OOP. its the same way when first learning to code, you dont use functions. but after you learn them, you cant imagine not using them. thats how classes are like. once you learn them, you cant live without them, so give it a shot one day, that way you can work on any project that comes your way
watched the vid and at the end I questioned myself: is it really free? thats such an amazing content! jokes apart, you're really going to save my course project! thank you so much! keep up the good content
You could really use the video chapters feature for long duration videos that TH-cam provides. Your videos are very helpful but I'm wondering why you've got only 2226 views till date (2nd Jan 2022). In my opinion, if I want a quick solution to verifying an email problem or a quick solution to creating a signup form and php code for that or login code, I'd really love to jump to a specific timestamp in a video rather than sitting and watching it for the next 2 hours. By the way, I'm at 1:26:00 right now still 40 minutes to go and I'm really, really, really enjoying it. Thought you could use an another suggestion.
thanks for the suggestion. i do add chapters on other videos but its time consuming and i have a lot of work to do. these videos are free and i dont get paid for making them, so its not really a good way to spend my time making chapters. if someone can chapter them, i can add the information to the description of pin the comment to help others
That was one of the most helpful videos i've seen so far. At 1:12:30 Wasn't there the option to use password_verify() or wasn't that an option 2 years ago?
Thank you. This gave me a very good start. I'm afraid the security would be fairly easy to break on this since a fake email address can be used and 100,000 posts of numbers to the verify form. I don't see any code discussed that would limit the number of attempts. Although it may seem non-trivial to send 100,000 posts to the verify form, I'm fairly sure that today it would be trivial indeed. If I am mistaken, please help me understand what I am missing in the code. What I did was set a session variable that to a counter. it gets set to 1 on registration and checked for value between 1 and less than 10 in the verify function, the verify function then increments this session variable. I just set my session expiry on the server to be one day so once they hit the limit they need to wait one day. I'm curious about what other solutions for this there are.
Thank you for this wonderful tutorial, I really appreciate it 👍 But, do you mean whenever you are going to sign up you must set your email account security as you did?
You got another subscriber :). I'm not into commenting in tutorials but this video makes myself to. The code is clean and the tutorial is clear. I want to say Thank you for everything. I can see your patience, hard work and talent in your video. I appreciate you bro, a lot.
@@ajgeriane8584 i dont have one because i wouldnt have time to manage it. but you can send me a message on facebook if you need to facebook.com/quickcode
Hello thank you so much for your lessons and we are witing for new things Quick Programming I just want to pay attion to something like when we use $errors variable that give us a error undifinde variable and I saw that you make a variable in the top of the page with a empty array but we can use isset($errors) and problem will solve with out add a empty value to the variable. So what do you think ?
Thanks. if you have an empty variable at the top, there will be no need to use isset, meaning less code. The less code the better. But there are no right or wrong ways to do it. If it works fine for you, no problem, use isset() function. As long as you don't use too much code to do the same thing
@@QuickProgramming yeah right and that's amazing I agree with you I just was think when i use isset is better for code and clean So use variable is better than isset
to host, simply copy the files to the public_html folder on the online server, then export your database and import it into an online database you create. thats pretty much it. but when you have time, watch this other video for some basic security habits as well. more knowledge is always better th-cam.com/video/pIO0pmMTJ6Y/w-d-xo.html
To get the password hash to work instead you just need to do the following in login instead : if(is_array($row)){ $row = $row[0]; if(password_verify($data['password'],$row->password)){ $_SESSION['USER'] = $row; $_SESSION['LOGGED_IN'] = true; }else{ $errors[] = "wrong email or password"; } }else{ $errors[] = "wrong email or password"; } } It turns out you just need to use password verify instead as this extracts the salt from the stored hash, it combines it with the password provided by the user, hashes this combination, and then compares it with the stored hash. If they match, the password is correct.
Nice tutorial......but I can't use php mailer is not working anymore..... please could you make a tutorial that uses nodemailer Thank I'll be great if I get a prompt response
i use phpmailer in my projects and it works fine. i just used it yesterday on a project and it worked fine. If you're using a live server, you dont need an third party classes, just use the mail() function, it works fine too but doesnt work on localhost. check php.net on how to use the mail function. they have plenty of example you can simply copy and paste
if there is another life, i would definitely marry you my guy. out of many tut yours the one works the best. god bless you. you just save my grade from failling.
Thanks for the wonderful tutorial, I have a question if I am using if($_SERVER['REQUEST_METHOD'] == "POST") and I have two forms on the same script how do I differentiate the both form if they are using post method
if you have 2 forms, give each submit button a value, then check which value was submitted to know which form was clicked. e.g then use this in your php: if($_SERVER['REQUEST_METHOD'] == "POST"){ if(isset($_POST['form1'])){ //form 1 was submitted } if(isset($_POST['form2'])){ //form 2 was submitted } } another way is to add hidden fields with values unique to each form, then check which value was submitted to know which form was submitted. its exactly like this example except you're using hidden inputs instead of the submit button
I like the tutorial, but I am stuck. I have been looking for similar tutorial with no luck 1. Lets say I want to retrieve the in session user data and make a profile that can be updated. 2. Retrieve all the data into a table, Do you have a tutorial covering that or documents you can refer or the syntax on how I can do that with PDO. I am still learning the concept of PDO and I would appreciate any help
I want some along these code $currentuser = $_SESSION['USER']->id; function getuserdata($currentuser) { $query = "select * from users where id = '$currentuser' limit 1"; $row = database_run($query); }
this will give you the concepts of PDO th-cam.com/video/w-haT1hXmjc/w-d-xo.html but you can watch my other series on setting up user profiles etc. the series are long but you can always stop once you learn enough. social website from scratch th-cam.com/video/VeOhsHkMaKQ/w-d-xo.html live chat th-cam.com/video/vKqL5OM6kIk/w-d-xo.html student management system th-cam.com/video/ztDGTjXlY5U/w-d-xo.html
You can still use Gmail or Yahoo even there. But if you want to have the email look like "email@your_domain.com", then create your email address using your hosting account. Every hosting account comes with email features to allow you to create email addresses. Then you can choose one of those emails to use. Use the email and the email password. As for SMTP server name, check your hosting account details. It's usually displayed somewhere or you can ask your hosting provider for it.
I need to check that, but securing your app is easy because you simply need an SSL certificate on your domain, I.e HTTPS instead of HTTP. Every hosting company now offers one for free when you first signup
Thank you sir for the detailed instruction, but since May 30, 2022 Google changed their policy: Google no longer supports the use of third-party apps or devices which ask you to sign in to your Google Account using only your username and password. The same issue is with yahoo as well. Any advices on how to be able to send mails sir?
watch some more videos ive done on login and signup here. they will help you understand. watch all three if possible. in case they all dont solve your problem, let me know afterwards so i can find you a solution. th-cam.com/video/WYufSGgaCZ8/w-d-xo.html th-cam.com/video/ymPlbgz6BoU/w-d-xo.html th-cam.com/video/pIO0pmMTJ6Y/w-d-xo.html
@@QuickProgramming how to make it like after clicking the register it will automatically go straight to verify and you cannot login if you are not verified?
Hello sir, when I registered it for the first time it goes well, but for the second time when I register with another email, it didn't send me the code, while it shows "NULL" in verified email in localhost database. What's the problem with that?
please, I have a problem that I'm receiving a code in my database (phpmyadmin) but not receiving any E-mail, I don't really know what's the problem, can you help?
there is an easier way to send emails but you need to use a live server for it to work. it doesnt work on local host. so create your code locally but test it on an online server. its as simple as using one function like this: $email = "someone@example.com"; $subject = "My subject"; $msg = "my message"; mail($email,$subject,$msg); you can use this instead, but it only works on a live server
One thing I found is Suppose if a user tries to sign in but not verify his email...then neither user can log in and his signup details will be saved in database even though his account is not verified.Any solution to it? Because if he didnt verify his email after certain time his details should be disappeared from the database
there is no need to delete user details even for non verified accounts, because the same user can come back after a month or even 6 months to try and signup again and you can save time by simply telling them to verify their email. secondly deleting rows from your database slows down your database because the index must be reset to account for the missing rows. Its better to just leave the rows. thirdly it simply adds code you dont really need. Dont make your apps more complicated than they need to be. A database can handle a billion rows without any problem. i doubt you will ever get 1 billion users on your platform so dont worry about it. Even if everyone on the planet signed up to your app and only 10 people were active, your database will work just fine
Hi man, I need some help. may I have your email or something to contact you cuz got a lot of error when using the code below from the mail.php $mail->MsgHTML($content); if(!$mail->Send()) { echo "Error while sending Email."; echo ""; var_dump($mail); return false; } else { echo "Email sent successfully"; return true; } Then the var_dump show me the object or array info.. but I don't quite understand.
its good you solved the problem. this method can work on any number of accounts as long as you enter the correct details. but there is no need to use multiple accounts. if you have a website were you want to be sending multiple emails to clients, you just need to open a company email and use that. if you want each user on your website to use their own email address, then you'll need to make the username and password as variables that you can input in the function depending on which user is logged in. but i dont recommend this since each user has to allow access to your app from their email settings, so this is not reliable. better to use only one company account to send all emails
Hello again Quick Programming for the problem when you try to login and the password keep change because of function password_hash you can solve it but using password_verify that take the login password from the user without hashing and take the password from the databse and it's check if it's the same or no liek that: if (count($errors) == 0) { $arr[':email'] = $data['email']; $pass = $data['password']; // don't hash the password $query = 'SELECT * FROM users WHERE email = :email limit 1'; $row = database_run($query, $arr); if (is_array($row)) { if ( password_verify($pass, $row[0]->password) ) // here we use the function { $_SESSION['USER'] = $row; $_SESSION['LOGGED_IN'] = true; } } else { $errors[] = 'Email or Password not correct'; } }
Thanks for the tip, yes I figured that out much later and have used it in other tutorials already. This was the first time I was using password_hash. I normally use hash() function
@@QuickProgramming yeah great. I will share the source code of the login form that I made with you I have just a little difreent of strutcer and I would like if you could check it for me if it's amazing and give me some advice Where I can send you my source code here or any other platform of social media?
hello @Quick Programming i need help ..... Fatal error: Uncaught PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'verify_db.verify' doesn't exist in C:\xammp new\htdocs\verify\functions.php:98 Stack trace: #0 C:\xammp new\htdocs\verify\functions.php(98): PDOStatement->execute(Array) #1 C:\xammp new\htdocs\verify\verify.php(19): database_run('insert into ver...', Array) #2 {main} thrown in C:\xammp new\htdocs\verify\functions.php on line 98
I would like to give you 1000 likes but only 1 like I can, thank you so much, I have watched many tutorials from many channels but I recommend to all people that subscribe you immediately.
Best tutorials on TH-cam, thank you so much!!! One follower for life of this channel!!
Thanks for this wonderful endorsement, I really appreciate it. Am glad the video was useful too😊
I got your problem in the middle of the video. I guess you already found out, but if not:
password_hash is different and much better than other hashing functions, because its *salted*.
but therefore, to login you have to use password_verify($password, $hashed_password).
$arr['email'] = $data['email'];
$query = "select * from users where email = :email limit 1";
$row = database_run($query, $arr);
if(is_array($row)){
$hash = $row[0]->password;
if(password_verify($data['password'], $hash)) {
$_SESSION['USER'] = $row;
$_SESSION['LOGGED_IN'] = true;
Thank you so much for everything!! I love your videos and I am learning a lot from them!
I would like to add a question:
Why do you prefer working with $redirect at 60min of the video?
Why not this shorter and simplier way:
function check_login(){
if(isset($_SESSION['USER']) && isset($_SESSION['LOGGED_IN'])){
return true;
}else{
header("Location: login.php");
die;
}
This looks like it is object oriented using PDO whereas I have been learning functional with mysql. What I have taken from this is PDO can still use mysql statements as I was under the impression PDO was an entirely different storage facility. You should have stated this in your title as people like me may not want to waste 2 hours getting confused, but there was still a learning experience just the same. Thank you for another eye opener. I guess now I have to learn the difference between object oriented vs functional. I have to stick with functional as this is the path I chosen. I will be able to incorporate this into my already existing system with a few tweaks. Thumbs Up!
glad you learnt something. PDO doesnt necessarily mean object oriented though. it can be used in procedural programming just as well. PDO is simply a universal way to connect to different databases. thats its primary job. it makes it easier to change database types at any time without having to change much of your code. it also works very well with prepared statements and thats why i prefer it.
but i would encourage you to learn OOP. i have an entire playlist on my channel. OOP makes your code more scalable. i cant imagine building a large website without OOP. its the same way when first learning to code, you dont use functions. but after you learn them, you cant imagine not using them. thats how classes are like. once you learn them, you cant live without them, so give it a shot one day, that way you can work on any project that comes your way
God bless you brother, I Just completed my login page, after trying lots of others, this stands out
watched the vid and at the end I questioned myself: is it really free? thats such an amazing content!
jokes apart, you're really going to save my course project! thank you so much! keep up the good content
😁thanks for the awesome compliment🙂
You could really use the video chapters feature for long duration videos that TH-cam provides. Your videos are very helpful but I'm wondering why you've got only 2226 views till date (2nd Jan 2022).
In my opinion, if I want a quick solution to verifying an email problem or a quick solution to creating a signup form and php code for that or login code, I'd really love to jump to a specific timestamp in a video rather than sitting and watching it for the next 2 hours.
By the way, I'm at 1:26:00 right now still 40 minutes to go and I'm really, really, really enjoying it. Thought you could use an another suggestion.
thanks for the suggestion. i do add chapters on other videos but its time consuming and i have a lot of work to do. these videos are free and i dont get paid for making them, so its not really a good way to spend my time making chapters. if someone can chapter them, i can add the information to the description of pin the comment to help others
Well done. Amazing everything I needed was here. So talented. Also after 2 hours of tiring programming you added source code for free. 😊😊
You're most welcome and thanks for leaving some feedback😊😊
thanks brother, you are such a nice person
Thanks for your kind words, I appreciate 😊
That was one of the most helpful videos i've seen so far. At 1:12:30 Wasn't there the option to use password_verify() or wasn't that an option 2 years ago?
you've really saved my course project
Glad to be of service❤️
Extremely helpful video, thank you.
Thanks so much for this wonderful tutorial
Thank you so much sir this is what i have been looking for 💞💞💞💞💞
Am glad to hear it, you're most welcome
You are a best teacher ❤❤❤❤
Excellent Tutorials! Thank you
Thank you so much...you deserve much more support ❤️
Thank you☺️
hey bro thats amazing content this help me alot
thank you
you're most welcome :)
I've been looking for something like this
Keep it going you're really amazing i really appreciate your effort 💪🏽💪🏽💪🏽💪🏽
thanks for your awesome feedback :D
Thank you. This gave me a very good start. I'm afraid the security would be fairly easy to break on this since a fake email address can be used and 100,000 posts of numbers to the verify form. I don't see any code discussed that would limit the number of attempts. Although it may seem non-trivial to send 100,000 posts to the verify form, I'm fairly sure that today it would be trivial indeed. If I am mistaken, please help me understand what I am missing in the code. What I did was set a session variable that to a counter. it gets set to 1 on registration and checked for value between 1 and less than 10 in the verify function, the verify function then increments this session variable. I just set my session expiry on the server to be one day so once they hit the limit they need to wait one day. I'm curious about what other solutions for this there are.
❤❤❤❤❤ pls never stop helping fellow web devs
it work, thank you
Awesome
thanks your tutorial is very interesting
you're most welcome :)
Thank you for this, you are a life saver
You're most welcome and thanks for your feedback
Hi sir! Please make a tutorial for signup using a Google account 🙏
It was awesome 👏👏👏👏🙏
kral kral
Nice
Thanks
Thank you for this wonderful tutorial, I really appreciate it 👍
But, do you mean whenever you are going to sign up you must set your email account security as you did?
at what video time is the issue you're talking about?
You got another subscriber :). I'm not into commenting in tutorials but this video makes myself to. The code is clean and the tutorial is clear. I want to say Thank you for everything. I can see your patience, hard work and talent in your video. I appreciate you bro, a lot.
Thanks for the sub! and i highly appreciate your feedback. It helps me make more content :))
@@QuickProgramming Do you have a discord channel?
@@ajgeriane8584 i dont have one because i wouldnt have time to manage it. but you can send me a message on facebook if you need to facebook.com/quickcode
wonderful
Cool
Hello thank you so much for your lessons and we are witing for new things Quick Programming
I just want to pay attion to something like when we use $errors variable that give us a error undifinde variable and I saw that you make a variable in the top of the page with a empty array but we can use isset($errors) and problem will solve with out add a empty value to the variable. So what do you think ?
Thanks. if you have an empty variable at the top, there will be no need to use isset, meaning less code. The less code the better. But there are no right or wrong ways to do it. If it works fine for you, no problem, use isset() function. As long as you don't use too much code to do the same thing
@@QuickProgramming yeah right and that's amazing I agree with you I just was think when i use isset is better for code and clean
So use variable is better than isset
thanks man
Happy to help. you're most welcome :)
I'm confused are you saying at 1:58:05 that my users have to have two-way authentication?
Hi i liked ur video and learned a more a lot in the complete login and sign up....Canu tel me how to host this is in live server
to host, simply copy the files to the public_html folder on the online server, then export your database and import it into an online database you create. thats pretty much it. but when you have time, watch this other video for some basic security habits as well. more knowledge is always better th-cam.com/video/pIO0pmMTJ6Y/w-d-xo.html
@@QuickProgramming Actually first I tired uploading the files as u said and did everything propelly
@@QuickProgramming but it is not working
@@QuickProgramming thanks for the reply
THANK YOU soooo much
To get the password hash to work instead you just need to do the following in login instead :
if(is_array($row)){
$row = $row[0];
if(password_verify($data['password'],$row->password)){
$_SESSION['USER'] = $row;
$_SESSION['LOGGED_IN'] = true;
}else{
$errors[] = "wrong email or password";
}
}else{
$errors[] = "wrong email or password";
}
}
It turns out you just need to use password verify instead as this extracts the salt from the stored hash, it combines it with the password provided by the user, hashes this combination, and then compares it with the stored hash. If they match, the password is correct.
Nice tutorial......but I can't use php mailer is not working anymore..... please could you make a tutorial that uses nodemailer
Thank I'll be great if I get a prompt response
i use phpmailer in my projects and it works fine. i just used it yesterday on a project and it worked fine. If you're using a live server, you dont need an third party classes, just use the mail() function, it works fine too but doesnt work on localhost. check php.net on how to use the mail function. they have plenty of example you can simply copy and paste
if there is another life, i would definitely marry you my guy. out of many tut yours the one works the best. god bless you. you just save my grade from failling.
THANK YOU SO MUCH
Hahaha thanks for the compliment😂 am glad to have saved your grade😁 you're most welcome
@@QuickProgramming can you do one with update? im having problem with update data to the database
can you make a tutorial about phone login and sign up using twillio
Thanks for the wonderful tutorial, I have a question if I am using if($_SERVER['REQUEST_METHOD'] == "POST") and I have two forms on the same script how do I differentiate the both form if they are using post method
if you have 2 forms, give each submit button a value, then check which value was submitted to know which form was clicked. e.g
then use this in your php:
if($_SERVER['REQUEST_METHOD'] == "POST"){
if(isset($_POST['form1'])){
//form 1 was submitted
}
if(isset($_POST['form2'])){
//form 2 was submitted
}
}
another way is to add hidden fields with values unique to each form, then check which value was submitted to know which form was submitted. its exactly like this example except you're using hidden inputs instead of the submit button
@@QuickProgramming Thank you so much
Hi. Thank you it's working😭
Can you put an CSS on it? Thank you
you're most welcome! you can put css on it yes
I like the tutorial, but I am stuck. I have been looking for similar tutorial with no luck
1. Lets say I want to retrieve the in session user data and make a profile that can be updated.
2. Retrieve all the data into a table,
Do you have a tutorial covering that or documents you can refer or the syntax on how I can do that with PDO. I am still learning the concept of PDO and I would appreciate any help
I want some along these code
$currentuser = $_SESSION['USER']->id;
function getuserdata($currentuser)
{
$query = "select * from users where id = '$currentuser' limit 1";
$row = database_run($query);
}
this will give you the concepts of PDO th-cam.com/video/w-haT1hXmjc/w-d-xo.html
but you can watch my other series on setting up user profiles etc. the series are long but you can always stop once you learn enough.
social website from scratch th-cam.com/video/VeOhsHkMaKQ/w-d-xo.html
live chat th-cam.com/video/vKqL5OM6kIk/w-d-xo.html
student management system th-cam.com/video/ztDGTjXlY5U/w-d-xo.html
the please enter valid username is not showing, its shows blank page
There is no error showing but nothing is inserted in verify table
Sir can you make a video tha show pogin in one tap!?
I mean , if user is logged and close the browser don't insert anymore their details
Is there a way I could apply the same method but to desktop application login not web page login please?
Please if the site is online, how do u make it send code, since we are not using gmail or yahoo there
You can still use Gmail or Yahoo even there. But if you want to have the email look like "email@your_domain.com", then create your email address using your hosting account. Every hosting account comes with email features to allow you to create email addresses. Then you can choose one of those emails to use. Use the email and the email password.
As for SMTP server name, check your hosting account details. It's usually displayed somewhere or you can ask your hosting provider for it.
@@QuickProgramming thanks sir
Why is my code not working on function 94
any instructions on what to do since google close the use of less secure apps
I need to check that, but securing your app is easy because you simply need an SSL certificate on your domain, I.e HTTPS instead of HTTP. Every hosting company now offers one for free when you first signup
Thank you sir for the detailed instruction, but since May 30, 2022 Google changed their policy:
Google no longer supports the use of third-party apps or devices which ask you to sign in to your Google Account using only your username and password.
The same issue is with yahoo as well.
Any advices on how to be able to send mails sir?
Are you sending from localhost or you'll be using a live server eventually?
Not getting emails from localhost
Thank you sir .. but why it is not working on me? haven't receive any email. please help
Its says wrong code after receiving from gmail what to do??
hello sir,
how i can modify code so that user can verify after registeration and than login should be allowed??
mail was not verified, still it is showing Verify Profile button. can any help me
how to solve such error
Warning: Undefined property: stdClass::$email_verified in C:\xampp\htdocs\verify\functions.php on line 137
remove the dollar sign on $email_verified
Thank you .this video help me with my project .
But i don't know to set the login page to be log in using username or email . Please help me 🥺
watch some more videos ive done on login and signup here. they will help you understand. watch all three if possible. in case they all dont solve your problem, let me know afterwards so i can find you a solution.
th-cam.com/video/WYufSGgaCZ8/w-d-xo.html
th-cam.com/video/ymPlbgz6BoU/w-d-xo.html
th-cam.com/video/pIO0pmMTJ6Y/w-d-xo.html
Hello, does it still work smoothly if many users registers and verify at the same time?
Yes it works just fine even with multiple users
@@QuickProgramming how to make it like after clicking the register it will automatically go straight to verify and you cannot login if you are not verified?
Hello sir, when I registered it for the first time it goes well, but for the second time when I register with another email, it didn't send me the code, while it shows "NULL" in verified email in localhost database. What's the problem with that?
Hello sir i am in big trouble need your help badly.
please, I have a problem that I'm receiving a code in my database (phpmyadmin) but not receiving any E-mail, I don't really know what's the problem, can you help?
there is an easier way to send emails but you need to use a live server for it to work. it doesnt work on local host. so create your code locally but test it on an online server. its as simple as using one function like this:
$email = "someone@example.com";
$subject = "My subject";
$msg = "my message";
mail($email,$subject,$msg);
you can use this instead, but it only works on a live server
its two factor authentication ?
The code can be used for that too, but this email verification after signup
WHY MY FILTER_VALIDATE_EMAIL DON'T WORK? PLEASE HELP ME...
its usually if you spell it incorrectly or something is missing in the code. please check it letter by letter to confirm everything is correct
@@QuickProgramming it is not really working, I check it for almost 3 hours. :((
Can its api be made? So that I can use it in Android app
you dont need an api to use an android app. just connect your app to the database the same way you connect a website to a database. no api is needed
how can i use it in Android studio
One thing I found is Suppose if a user tries to sign in but not verify his email...then neither user can log in and his signup details will be saved in database even though his account is not verified.Any solution to it?
Because if he didnt verify his email after certain time his details should be disappeared from the database
there is no need to delete user details even for non verified accounts, because the same user can come back after a month or even 6 months to try and signup again and you can save time by simply telling them to verify their email.
secondly deleting rows from your database slows down your database because the index must be reset to account for the missing rows. Its better to just leave the rows.
thirdly it simply adds code you dont really need. Dont make your apps more complicated than they need to be. A database can handle a billion rows without any problem. i doubt you will ever get 1 billion users on your platform so dont worry about it. Even if everyone on the planet signed up to your app and only 10 people were active, your database will work just fine
@@QuickProgramming thanks for clearing the doubt
good day, i tried the code but it's not sending verification email, can you help me sir fix this error
What about forgot password?
Good day my good sir, please im so sorry to bother you with this, but do u have anything on reset password, thank you
its no bother. yes i do have a tutorial on that here th-cam.com/video/cAdIUcobXa0/w-d-xo.html
@@QuickProgramming thank you for your reply
no error but I am not recieving the code in my email account , help me please sir
Did you find out the problem? Because I have the same
Same bro. How did you fix that bug?
Hi man, I need some help. may I have your email or something to contact you cuz got a lot of error when using the code below from the mail.php
$mail->MsgHTML($content);
if(!$mail->Send()) {
echo "Error while sending Email.";
echo "";
var_dump($mail);
return false;
} else {
echo "Email sent successfully";
return true;
}
Then the var_dump show me the object or array info.. but I don't quite understand.
ok, suddenly problem or bug settle but may I know this kind of methods only work on one account ??
its good you solved the problem. this method can work on any number of accounts as long as you enter the correct details. but there is no need to use multiple accounts. if you have a website were you want to be sending multiple emails to clients, you just need to open a company email and use that.
if you want each user on your website to use their own email address, then you'll need to make the username and password as variables that you can input in the function depending on which user is logged in. but i dont recommend this since each user has to allow access to your app from their email settings, so this is not reliable. better to use only one company account to send all emails
@@QuickProgramming Ok, got it. Thank your explanation and suggestion. I will take more time to learn it.
Hello again Quick Programming for the problem when you try to login and the password keep change because of function password_hash you can solve it but using password_verify that take the login password from the user without hashing and take the password from the databse and it's check if it's the same or no liek that:
if (count($errors) == 0)
{
$arr[':email'] = $data['email'];
$pass = $data['password']; // don't hash the password
$query = 'SELECT * FROM users WHERE email = :email limit 1';
$row = database_run($query, $arr);
if (is_array($row))
{
if ( password_verify($pass, $row[0]->password) ) // here we use the function
{
$_SESSION['USER'] = $row;
$_SESSION['LOGGED_IN'] = true;
}
} else {
$errors[] = 'Email or Password not correct';
}
}
Thanks for the tip, yes I figured that out much later and have used it in other tutorials already. This was the first time I was using password_hash. I normally use hash() function
@@QuickProgramming yeah great.
I will share the source code of the login form that I made with you I have just a little difreent of strutcer and I would like if you could check it for me if it's amazing and give me some advice
Where I can send you my source code here or any other platform of social media?
the reset password?
here th-cam.com/video/cAdIUcobXa0/w-d-xo.html
it's amazing that it takes so many hours of programming for things that don't last long
@@filippohinceanu7392 well, i guess thats why programmers are paid so much🙂 coding takes too much patience, its like animation
@@QuickProgramming the page works and sends the data, but the latter are not entered into the database
woah thats hard
;)
Youre Amazing!!!!!!!🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰
Thanks 🙂
hello @Quick Programming i need help ..... Fatal error: Uncaught PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'verify_db.verify' doesn't exist in C:\xammp new\htdocs\verify\functions.php:98 Stack trace: #0 C:\xammp new\htdocs\verify\functions.php(98): PDOStatement->execute(Array) #1 C:\xammp new\htdocs\verify\verify.php(19): database_run('insert into ver...', Array) #2 {main} thrown in C:\xammp new\htdocs\verify\functions.php on line 98
that means you havent created the verify table inside the verify_db database
I would like to give you 1000 likes but only 1 like I can, thank you so much, I have watched many tutorials from many channels but I recommend to all people that subscribe you immediately.
thank you, i appreciate your compliment and support :))