I did my research before deciding on a signup / login method and found the email verification keeps a lot of the riffraff out. Your method here is a gem. Thank you very much. PS I hope to add SMS / phone verification in as well soon.
Never knew you could just update the string with a new value 🤔 out of all the years I've been using PHP too! Time to do some coding updates 😂 Thanks so much for the video!!!
Hey, i was trying to learn how to make a secure registration system for a new web app, all i can say is you are really helpful and clear. Amazing job continue with such tutorials. Subscribed!
So, a couple things here. 1) Use password_hash when storing passwords (check out my video). 2) Using prepared statements is the best approach to prevent SQL injection (check out my video). 3) You'll notice I did not strip htmlspecialchars from the GET method, exposing the database. Do that.
What Mr.Sean did in 21mts, other Channels do half that in 180mts, while all the time incorporating several confusing code Routines, thus making them too complex for anyone to follow, and yet garner all the traffic and more so leading a lot astray. YT, should have a mechanism put in place to identify Genuine and service minded individuals like Mr. Sean and promote them.
Those 6 dislikes are literally BS. They probably don't have a smtp server running, therefore their mail() function didn't work, so they decided to dislike it. Anyway, this video was amazing and very helpful. Thank you very much, it helped me understand some stuff I was iffy about. Good luck, I'm definitely going to subscribe.
Just came across your channel and I'm thoroughly enjoying it. I see your last video was posted 4 months ago, and I'm hoping that you're just on an extended break. You're videos are so easy to follow, I'm hoping to learn a lot more php and MySQL from future videos!
Bless you. This has been extremely helpful. I'm going to do the code and try it out but from your explanation, I'm sure things will work out. You are audible, clear, detailed and just the perfect person for this topic. Thanks so very much.
Love this channel, loved the explanation, loved the syntaxis, loved everything. Great work, you helped me understand few things. Anyways I have to improve. But the only way to learn is practice everyday
12:36 This code you're typing is extremely susceptible to SQL injection. You should never immediately put user provided data directly into a SQL string for any reason. You need to use prepared statements as well as validate all inputs
@@smileblockbot As I mentioned you should be using prepared statements as well as validating input. I prefer to use PDO not the mysqli_* functions but if you're stuck with them then you can use the mysqli prepare functions. Here's an example from the PHP documentation: www.php.net/manual/en/mysqli.prepare.php
As always with your videos clear precise and easy to understand, thanks I have learnt a lot from all your videos. It would be great to see an update on how to convert this code to work with PDO and the new security as shown in your other video Password Security. I have tried a few times, but my knowledge is not good enough yet. I can get the updated way to hash but not yet worked out how to get verify to work. But this way works a treat thanks again!
I am not the best at PHP but how do I know if I'm "Logged in". Is there a session value or anything that I can use to see if the user is logged in? I want to do certain changes to my website when I am actually logged in. For example, it says login at the top right corner when I'm logged out and when I'm logged in it will say logout. Very good video! I was searching for a video like this for about 1 hour. Glad I found this video tutorial.
He podido seguir el procedimiento minuto a minuto. Su código ya esta especificado para PHP 7 por lo que no me dio errores en ningún momento. Llevo una semana tratando de implementar el sistema y siguiendo su vídeo lo pude implementar y adaptar a mis requerimientos en 2 días. Gracias. I have been able to follow the procedure minute by minute. Its code is already specified for PHP 7 so it did not give me errors at any time. I have been trying to implement the system for a week and following its video I was able to implement and adapt it to my requirements in 2 days. Thank you. (Google Translation).
this code is not updating becose am working from my domain what do i replace ($resultset->num_rows == 1) with so that it can update if($resultset->num_rows == 1){ //validate the mail by updating the database $update=mysqli_query($link,"UPDATE users SET verified = 1 WHERE vkey = '$vkey' LIMIT 1");
if($update){ echo"Your account has been verified sucessifuly. You may now log in"; }else{ echo $mysqli->error; }
Hi! Thank you for this great video. You showed us within 21 min what most other channels would have take 2 hours to explain and not with your level of clarity. Trust me! Your code works amazingly well. But one thing... I would like to restrict the emails duplication. I tried a thousand codes. Nothing works. Your help would be greatly appreciated. Thank you in advance!
The problem with copying and pasting source code is that those who do it almost never know how it actually works. Thanks for this excellent video and the clear explanation.
Fair comment, but it is also nice to know the tutorial you're following actually works before you invest the time trying to understand and learn from it.
Help on the verify.php I entered word from word of your code however it skips the code and just says something went wrong. If I can email you my code could you tell me what I’ve done wrong. I retraced my steps and went very slowly .
Not working for me:`( does 'send email from localhost' videos all settings required for this process, or i should reset those files as default settings,,,
I followed and copied the code on this carefully but I find that the database activated status is being updated to being verified on sending of the email to the newly registered user, without the email link having to be clicked on. Does anyone else have this issue?
Hey Mike - It wouldn't be possible to update the verified flag when sending the email unless specifically coded to. If you'd like, I can look over your code.
@@phpBasics Thanks for your reply, very much appreciate that. Where can I post my code to. It's on a dev site and don't really want to throw url out there at the moment.
Thank you for the video. Can you please make a video or explain how to auto verify an account without email verification or manual verification from the backend. I mean the system should automatically verify the new user account.
@@RacoonCH - You can run a query against the database to see if that username already exists. If you need help, feel free to message me on Skype: CoolEditz
i followed a 2hr tutorial and got it working. but with your 15min login and this 20min registration/email verify tutorials i cant get either working!!!
I´m using pdo and got the error message "PDOStatement: Field 'verified' doesn't have a default value" (and got another one saying field vkey needs a default value too). I set null for vkey and 0 vor veriefied. when saving first user, vkey gets updated with the key. everything´s fine then. thanks!
"Warning: Attempt to read property "num_rows" on bool in C:\xampp\htdocs egistration\verify.php on line 9 This is invalid" why is it showing this in my verify.php file?
I have a video that shows how to set up sendmail for Gmail and Yahoo. You cannot send directly from localhost without a registered domain, so those you need an SMTP relay like Gmail.
That was just a semicolon ( ; ) error on line 29 provide the text with double quote to end the string and ; to end the statement. Here it is: what's in the video-----> echo "x y z what to edit-------> echo "x y z "; That's it it works well
Yaw thanks for this amazing tutorial. I just have one problem and I will past the error message below. " Trying to get property 'num_rows' of non-object in C:\xampp\htdocs\web2 egisteration form\verify.php on line 11"
Isn't there any other way of form validation?? Suppose we have 50+ fields in a form.. so we have to put validation on each field to check whether it is empty or not or the character length is correct or not. This will make the code lengthy
@@phpBasics sir if I want to add any payment gateway which can be rederect to the acknoledgement page with transuction id , name then what will be the procedure?
The thankyou.php page is just an arbitrary page to re-direct the user to. It contains no PHP; just a page that says thank you. If you need further assistance, feel free to reach me on Skype: CoolEditz
Everyone should be warned that this video introduces a severe SQL injection vulnerability around 12:30, which means any app coded with this method IS vulnerable and probably can be exploited to take full control of your database. This can be solved by properly escaping the user-submitted input. The author should correct the video or delete it.
Hey I was trying to make a login system which allow different users to get to a specific page after login. Suppose a person from X-company login then he should be redirected to that particular page for X-company. Can you please help and guide me.
Unfortunately, doesn´t work. The error message I get: Internal Server Error mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() For setup I followed your tutorial, using yahoo acount and "fake sendmail for windows (the link you provide). but on the site it states: Unfortunately I no longer have the time or resources to provide any support or updates to fake sendmail for windows. 2nd attempt failed aswell, using gmail, following the instructions here: forum.osticket.com/d/92858-resolved-email-configured-but-falls-back-to-phpini-config/3 What I use: Wamp 3.2.0 - 64 bit PHP 7.3.2. For any help, thanks much in advance!
Your soothing voice and clear instructions make this tutorial the best out there. Thank you for this sir you are great
I did my research before deciding on a signup / login method and found the email verification keeps a lot of the riffraff out. Your method here is a gem. Thank you very much. PS I hope to add SMS / phone verification in as well soon.
really like this channel. sean has a great voice and should be doing voice overs as a side hustle.
Never knew you could just update the string with a new value 🤔 out of all the years I've been using PHP too! Time to do some coding updates 😂
Thanks so much for the video!!!
Hey, i was trying to learn how to make a secure registration system for a new web app, all i can say is you are really helpful and clear. Amazing job continue with such tutorials. Subscribed!
So, a couple things here. 1) Use password_hash when storing passwords (check out my video). 2) Using prepared statements is the best approach to prevent SQL injection (check out my video). 3) You'll notice I did not strip htmlspecialchars from the GET method, exposing the database. Do that.
took me a week to complete the video from installing required stuff to running into problems, to fixing updated things anyhow great video!
What Mr.Sean did in 21mts, other Channels do half that in 180mts, while all the time incorporating several confusing code Routines, thus making them too complex for anyone to follow, and yet garner all the traffic and more so leading a lot astray. YT, should have a mechanism put in place to identify Genuine and service minded individuals like Mr. Sean and promote them.
Those 6 dislikes are literally BS. They probably don't have a smtp server running, therefore their mail() function didn't work, so they decided to dislike it. Anyway, this video was amazing and very helpful. Thank you very much, it helped me understand some stuff I was iffy about. Good luck, I'm definitely going to subscribe.
its not working for me bcz of smtp server . how i can have one ?
Just came across your channel and I'm thoroughly enjoying it. I see your last video was posted 4 months ago, and I'm hoping that you're just on an extended break. You're videos are so easy to follow, I'm hoping to learn a lot more php and MySQL from future videos!
Hi Ray. I have quite a bit of new and exciting material to cover. Videos coming very soon.
Bless you. This has been extremely helpful. I'm going to do the code and try it out but from your explanation, I'm sure things will work out. You are audible, clear, detailed and just the perfect person for this topic. Thanks so very much.
i try and mail function doesn to work, whats about about you
Awesome work ! I integrate that to my project and it's working like a charm.
Love this channel, loved the explanation, loved the syntaxis, loved everything. Great work, you helped me understand few things. Anyways I have to improve. But the only way to learn is practice everyday
12:36 This code you're typing is extremely susceptible to SQL injection. You should never immediately put user provided data directly into a SQL string for any reason. You need to use prepared statements as well as validate all inputs
@@smileblockbot As I mentioned you should be using prepared statements as well as validating input. I prefer to use PDO not the mysqli_* functions but if you're stuck with them then you can use the mysqli prepare functions. Here's an example from the PHP documentation:
www.php.net/manual/en/mysqli.prepare.php
This is the best tutorial on this topic by far. Good explanation, and everything works well! Thank you so much!
You are great, thank you. Clear voice and nice explanations.
I watched your video and it was very helpful for me. Thanks a lot for making such informative videos.. and the method of explaining was good.
As always with your videos clear precise and easy to understand, thanks I have learnt a lot from all your videos. It would be great to see an update on how to convert this code to work with PDO and the new security as shown in your other video Password Security. I have tried a few times, but my knowledge is not good enough yet. I can get the updated way to hash but not yet worked out how to get verify to work. But this way works a treat thanks again!
This is the first effective tutorial I've watched that provides an email verification system. It worked BTW, god bless!
this was awesome! it worked very well for me
Amazing and your explanation way is very simple
thank you Boss
This has been helpful. Thanks bro!
Works perfectly, thank you :D
Great tutorial, very clear explanation, you have a new subscriber now
Wow you have the gift of teaching! Thank you very much. God bless you!
Nice... Keep up the good work👍👍👍
I am not the best at PHP but how do I know if I'm "Logged in". Is there a session value or anything that I can use to see if the user is logged in? I want to do certain changes to my website when I am actually logged in. For example, it says login at the top right corner when I'm logged out and when I'm logged in it will say logout. Very good video! I was searching for a video like this for about 1 hour. Glad I found this video tutorial.
Hi Max. Check out my Login System video. If this doesn't answer your question, hit me up on Skype: Cooleditz -
ua-cam.com/video/-7JdLn5gOfg/v-deo.html
This Video was really helpful for me...Thank you soo much.
Thank you very much. You sir are a gentleman and a scholar.
When I click the Register Account verification, it only shows "The requested URL was not found on this server.". It did not execute the verify.php :(
thank bro...this was very helpful for my project !
Great tutorial! Much appreciated!
When I send people to my verify page with the vkey in the link I get error that "The requested URL was not found on this server."
wow I thought it would be difficult to do that, apparently not because your explanation was very clear.
edit : stuck on mail server
Great Tutorial. Happy Learning 😃
He podido seguir el procedimiento minuto a minuto. Su código ya esta especificado para PHP 7 por lo que no me dio errores en ningún momento. Llevo una semana tratando de implementar el sistema y siguiendo su vídeo lo pude implementar y adaptar a mis requerimientos en 2 días. Gracias.
I have been able to follow the procedure minute by minute. Its code is already specified for PHP 7 so it did not give me errors at any time. I have been trying to implement the system for a week and following its video I was able to implement and adapt it to my requirements in 2 days. Thank you. (Google Translation).
this code is not updating becose am working from my domain
what do i replace ($resultset->num_rows == 1) with so that it can update
if($resultset->num_rows == 1){
//validate the mail by updating the database
$update=mysqli_query($link,"UPDATE users SET verified = 1 WHERE vkey = '$vkey' LIMIT 1");
if($update){
echo"Your account has been verified sucessifuly. You may now log in";
}else{
echo $mysqli->error;
}
The idea behind this channel is to teach people how to code, not provide free source code for lazy people.
Hi! Thank you for this great video. You showed us within 21 min what most other channels would have take 2 hours to explain and not with your level of clarity. Trust me!
Your code works amazingly well. But one thing... I would like to restrict the emails duplication. I tried a thousand codes. Nothing works.
Your help would be greatly appreciated. Thank you in advance!
I couldn't agree with you more. Keep it up bro!
The problem with copying and pasting source code is that those who do it almost never know how it actually works. Thanks for this excellent video and the clear explanation.
Fair comment, but it is also nice to know the tutorial you're following actually works before you invest the time trying to understand and learn from it.
@@selfregulator Well, if that's not gonna work, you'll have to 'self regulate' it. ;)
You are a master I was looking for that
Thank you sir! do u do paid lil gigs?
Message me on skype: CoolEditz
Thank you very much! God bless
Nice. Thank you for this great tutorial.
Parse error: syntax error, unexpected identifier "VALUES"
I got error smtp server response 530 5.7.0 must issue a starttls command first..i cant resolve it its annoying
I couldn't really sent an email from localhost.... how can I do that??? I tried other configurations but no lock! ??? :X
Could you provide the code for this via Github or Google Drive?
Thanks very much for doing this tutorial it's helped me no ends. :)
We have a capstone project and we need to do a email verification
How would i program an email account?
Very Nice Explanation!
Help on the verify.php I entered word from word of your code however it skips the code and just says something went wrong. If I can email you my code could you tell me what I’ve done wrong. I retraced my steps and went very slowly .
Shiit your so good on thiis ❤️
How can send in form of OTP verification to user that signup on my website??
Thanks, but a question that you didn't provided your sending email password so how could it send email without verifying? Thanks again sir
Not working for me:`(
does 'send email from localhost' videos all settings required for this process, or i should reset those files as default settings,,,
I followed and copied the code on this carefully but I find that the database activated status is being updated to being verified on sending of the email to the newly registered user, without the email link having to be clicked on. Does anyone else have this issue?
Hey Mike - It wouldn't be possible to update the verified flag when sending the email unless specifically coded to. If you'd like, I can look over your code.
@@phpBasics Thanks for your reply, very much appreciate that. Where can I post my code to. It's on a dev site and don't really want to throw url out there at the moment.
@@mikeyells5353 You can Skype me at CoolEditz or use pastebin
@@phpBasics Thanks. I'll sort out tomorrow. I'm in England and it's now late (yawn) night. Really do appreciate your help.
Hi.... just wondering if you've had a chance to look at the pastebin yet?
Hello Sir, I have a problem that i don't see any mail. Please, help me.
great! thats all i want. thank u a lots
yeah great tutorial but ive gotta little problem
Trying to get property 'num_rows' of non-object in C:\xampp\htdocs\verification\verify.php on line 10
yeah ive got the same problem toooo how to fix it
your voice, so deep😭
It worked thaks bro .. god bless
LOVE the video!
Thank you for the video. Can you please make a video or explain how to auto verify an account without email verification or manual verification from the backend. I mean the system should automatically verify the new user account.
What's the point of verification if it auto-verifies? You can simply leave out the verification altogether.
@@RacoonCH - You can run a query against the database to see if that username already exists. If you need help, feel free to message me on Skype: CoolEditz
i followed a 2hr tutorial and got it working. but with your 15min login and this 20min registration/email verify tutorials i cant get either working!!!
Pls can you create the email otp verification in php video😓😥😓??
Sir, how to specify the domain of the email.
I´m using pdo and got the error message "PDOStatement: Field 'verified' doesn't have a default value" (and got another one saying field vkey needs a default value too). I set null for vkey and 0 vor veriefied. when saving first user, vkey gets updated with the key. everything´s fine then. thanks!
I believe you need to establish default variables in PHPMyAdmin.
I DID EXACTLY what you did,but when i submit the form,it just reloads and nothing happens
Skype: CoolEditz
I don't get vkey to db. How to fix?
i manage to send me some confirmation but i cant continue through the verification when it comes to me loggin in. :(
The video is well detailed but it's not working for me.
When I do the login it says all the code with $mysqli-> in front of it. Does the tutorial work on the newer PHP versions?
Same problem. Can you answer.. @phpBasics? :)
Voice is so smooth.
Are you not using password_verify ? Can you explain why not, and if you would use it with password_hash, how would you implement it ?
Hi, I have a video on password_hash. If you need assistance, you can reach me on Skype: CoolEditz
"Warning: Attempt to read property "num_rows" on bool in C:\xampp\htdocs
egistration\verify.php on line 9
This is invalid" why is it showing this in my verify.php file?
More than likely a syntax error.
hey,
do I need a mail server, to be able to use this?
I mean, for sending emails to new users, that registered.
I have a video that shows how to set up sendmail for Gmail and Yahoo. You cannot send directly from localhost without a registered domain, so those you need an SMTP relay like Gmail.
How you fix this syntax problem? I can’t do it...
That was just a semicolon ( ; ) error on line 29 provide the text with double quote to end the string and ; to end the statement.
Here it is:
what's in the video-----> echo "x y z
what to edit-------> echo "x y z ";
That's it it works well
@@ajay6057 Thank you haha
Yaw thanks for this amazing tutorial. I just have one problem and I will past the error message below.
" Trying to get property 'num_rows' of non-object in C:\xampp\htdocs\web2
egisteration form\verify.php on line 11"
me too. Do you have a fix?
Same
The solution is : You made an error in the SELECT .... Just verified.
you're awsome. buddy! thks
Isn't there any other way of form validation?? Suppose we have 50+ fields in a form.. so we have to put validation on each field to check whether it is empty or not or the character length is correct or not.
This will make the code lengthy
Try this!
function validateReg($username,$password,$verPassword,$email)
{
$argNum = func_num_args();
for($x=0;$xerrors[] = "All fields are required.";
break;
}
}
Is there any need to include a timer i.e time set for the link sent?
You might want the link to expire after a certain length of time. In that case, yes.
its not working for me bcz of smtp server . how i can have one ?
very usefull vedio and I have one question how can I set payment gate way with this form.
I'm not sure what you mean.
sir if I want to add payment gateway wich can rederect to the acknolegement page after successfull payment then what will be the procedure?
@@phpBasics sir if I want to add any payment gateway which can be rederect to the acknoledgement page with transuction id , name then what will be the procedure?
@@Khapa123 You would need to use sessions to store the data between pages.
I do not see thankyou.php works in your video. Although I have typed all codes following you but unable to complete it as there is no thankyou.php ..
The thankyou.php page is just an arbitrary page to re-direct the user to. It contains no PHP; just a page that says thank you. If you need further assistance, feel free to reach me on Skype: CoolEditz
I liked it! Thank you
Top voice sir...
Everyone should be warned that this video introduces a severe SQL injection vulnerability around 12:30, which means any app coded with this method IS vulnerable and probably can be exploited to take full control of your database.
This can be solved by properly escaping the user-submitted input.
The author should correct the video or delete it.
Read the description
Thank you sir ji🙏🏾🙏🏾🙏🏾
i love your videos
Hey I was trying to make a login system which allow different users to get to a specific page after login. Suppose a person from X-company login then he should be redirected to that particular page for X-company. Can you please help and guide me.
You could redirect the page based on their email address domain name John@SomeCompany.com.
phpBasics how ? Can you guide me on this ,
@@kumarashwiniwise1 Skype: Cooleditz
i followed everything but my mail is not sending......
Did you watch the video on how to setup email from localhost?
@@phpBasics i watched only this one
Very useful, thank you
Notice: Trying to get property 'num_rows' of non-object in C:\xampp\htdocs\messenger\verify.php on line 7
You probably didn't put the $ in front of the variable.
could you please make this PHP Registration w/ Email Verification in PDO version
Verify.php is not working. It says "trying to get property of non-object in C:\...". Can you tell me something sir?
Did you get it figured out? Skype: Cooleditz
is every attribute set to not null in mysql? also can I use the same method if I want to send an email from my rented server?
If you send mail from a rented server, they should already have mail configured.
@@phpBasics i see, thank you
i created the thank you page , but still i didn't receive any any email.. my mail box is still empty where
skype: CoolEditz
you want me to skype you
Unfortunately, doesn´t work. The error message I get:
Internal Server Error
mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()
For setup I followed your tutorial, using yahoo acount and "fake sendmail for windows (the link you provide). but on the site it states: Unfortunately I no longer have the time or resources to provide any support or updates to fake sendmail for windows.
2nd attempt failed aswell, using gmail, following the instructions here:
forum.osticket.com/d/92858-resolved-email-configured-but-falls-back-to-phpini-config/3
What I use:
Wamp 3.2.0 - 64 bit
PHP 7.3.2.
For any help, thanks much in advance!
If you'd like, send me a message on Skype: Cooleditz
can i download the code on guithub?
instead of declaring database in every file create one file to declare the database and call it in every file but thanks for your videos 👍