Hello readers, Today in this blog you’ll learn how to create a Login & Signup Form with Email Verification using PHP and MySQL. Earlier I have shared a blog on How to configure XAMPP to send Mail from Localhost in PHP? If you haven’t still read this blog, then I want to suggest you first read that blog and continue this because in that blog I’ve taught you how to configure XAMPP before sending mail from the localhost.
As we all know, the login and & Signup Form is the set of different input fields – Name, Email, Username, Password, etc. which are used to authenticate users before giving access to the site. In our program [log in & Signup Form with Email Verification], there are eleven PHP files and one is a CSS file means there are a total of twelve files in our user name folder.At first, on the webpage, there is shown only a login form and inside the login form, there is a signup now link to redirect the user to the first signup before login. When the user tries to log in without even signup the form, there is displayed an error message labeled as “It looks like you’re not yet a member! Click on the bottom link to signup”.
In the signup form, while the user is signing up, if he enters the same email, which already exists in our database then there is displayed an error message labeled as “Email that you’ve entered is already exist!”. And when the user doesn’t match two password combinations, there is also displayed an error message labeled as “Your confirm password not matched”.
When the user filled up all the required inputs correctly, then a six-digit verification code number is sent to the user’s email and he will be redirected to the OTP Verification page. If the user entered the wrong code, there is displayed an error message labeled as “You’ve entered incorrect code!”. If the user exit the OTP verification code page without entered a valid or correct verification code and come to the login page to log in with the same email and password which he used to sign up, then he will be again redirected to the OTP page and there is displayed an info message labeled as “It looks like you’ve not verified your email”.
When the user entered the correct verification code, then he will be redirected to the Home Page. On the home page, there is a navbar with a logo on the top left corner and the logout button on the top right corner. At the center of the home page, there is a welcome message with the name of the user which he entered while signing up for the form. And when the user clicked on the logout button, he will be redirected to the login page and at this time he can log in with their correct email and password and will be directly redirected to the home page without redirecting to any other page.
If you’re feeling difficult to understand what I am saying. You can watch a full video tutorial on this program (Login & Signup Form with Email Verification).
Video Tutorial of Login & Signup Form with Email Verification
In the video, you have seen the demo of this project and I hope you love it. In this project, I have sent mail from Localhost using PHP and you must have to configure your XAMPP to Send Mail from Localhost in PHP. If you don’t configure your XAMPP then your mail which is used to send OTP code to the user won’t be sent and there is no meaning to download the source files of this project.
Login & Signup Form with Email Verification [Source Codes]
Click the given download button and you’ll be redirected to the timer page, just wait until the timer completed. Once the timer complete then the zip file will automatically download. Once you download the zip file, just extract it and you’ll get a folder with all required coding files with a userform.sql file. After these, create the database and the database name must be userform then import the userform.sql file by clicking on the import tab in the database. This file will create all required tables with columns. That’s it you don’t need to do anything more.
Lit!
Thank you..Keep visiting.
Thanks man…excellent work
You’re welcome
Nice Tutorial I implemented This Tutorial on my Project
Hello!
Very good tutorial!
how we can make the connection with server using wamp please make a video
Thank you…Keep visiting!
This is great work
whats next after creating the table
good job bro
Create the php files and paste the following codes.
Thank you bro
i include all the files to a html file but nothibg works. how to make them works ??
Thats php … are you stupid or …
Please learn some basic php before pasting these codes. You've to create php files not html files.
where to save this file ???
Thanks much sir
You're welcome.
thank you
Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, bool given in C:xampphtdocs200controllerUserData.php on line 19
where is the mistake?
even i had the problem with this then i figured out that you’ve got to create the database first by importing the sql file then this error will disappear inshallah.
good job
What is the step to take after downloading the files and programming Xampp ? Where should I place my php file in " How to configure XAMPP to send Mail from Localhost in PHP ?"
After downloading files just create a database, table, and columns with that names which are mentioned above and to configure XAMPP read this blog – https://www.codingnepalweb.com/2020/09/how-to-configure-xampp-to-send-mail-from-localhost-in-php.html
On line no.19
its saying failed to insert data into database
Database error please check the name of your database with the connection.php file.
dude i want to add a city and institution also in registration form but i cant store values in the database
What's the error you're facing while inserting data's into database?
how to open it in the browser
Read this article – https://www.quora.com/How-do-I-open-a-PHP-file-in-a-browser
hi can you make a video on how to connect thise codes and how to create a server like that reply me the link of the
thank you
Okk..stay tuned with us!
Can you please provide direct link of files becaz when i click link the timer did,nt start helo me sir!!
I'm sorry for that and now it has been fixed. Please download again from the same link.
can u plz make one tutorial for phpmyadmin??
Sure stay tuned 🙂
and when i press the login button or the sign up botton it sends me to an error screen 😮
What's the error?
my thing im working on only uses html is there a way to do this on html? like save the data?
No with only html you can't!
it doesnot send any email please help me
Did you configure your XAMPP ?
Thank you codingnepal amazing help
Warning: mail(): SMTP server response: 530 5.7.0 Must issue a STARTTLS command first. 78sm5550625pfz.211 – gsmtp in C:xampphtdocsLogin and Signup Form with Email Verification – PHPcontrollerUserData.php on line 33 (Failed while sending code)
where the last php file should be save and with which name plz specify.
Create a php file inside the HTDOCS folder with .php extension and paste the following codes in this file then put the receiver email and sender email address in the mentioned fields.
How do i upload the files i donwloaded to Adobe Dreamweaver?
Yes text editors doesn't matter
im a beginner complete beginner to php so just a question why isnt their any .html files like how would i see the form if theirs only .php files
You've to install server to run .php file. You can google it for more info.
Please share file database.sql
I've shared all required things in this blog. Please read carefully.
What did you used ? blogger or wordpress for this site .
Blogger
good
Thank you
Can you share the source code of your website ??
It looks very attractive and easy to use.
You can read our FAQ for this.
nice work bro
Thanks bro
show form verify but no see code in email help me plz
I didn't understand
Good work bro
Thanks bro
Sorry, failed while sending mail!
why ?
what should be writ in receiver and sender in send_mail.php?
help phz i writ every thing you do
Did you configure XAMPP folder??
Thank you my lovely broo))
You're welcome bro 🙂
Nice
Thank you 🙂
Failed while sending code!
I was trying to implement it in my hosting .But I am getting this error. But data perfectly saved in database,since I changed few necessary changes to connect with my hosting databases.Now my question is why I am facing this error?
please help me and thanks a lot for this great tutorial.
It's maybe there is some mistakes on variables, database name or something else.
How to add push notification which says codingnepal wants to send you notification 1.allow 2. No thanks .
Please give code for that
Hii,
i have one error when i register new account it shows
"Failed while inserting data into database!"
i had check my database name but its correct so where is problem.
please help me to solve this error
Please contact me on Email or Insatgram.
Very Useful Thanks
You're welcome
Nice Job! But I have a problem it says "Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:xampphtdocscontrollerUserData.php on line 33" My code is the same as yours |Failed while sending code!" Can you help me?
Hi CodingNepal, on my computer it is not working, do u have a IDE for the PHP?
You have to configure you XAMPP, please read this blog properly.
You have install XAMPP server to run php file.
Warning: mail(): SMTP server response: 530 5.7.0 Must issue a STARTTLS command first. 22sm22663187pfn.190 – gsmtp in C:xampphtdocsLogin and Signup Form with Email Verification – PHPcontrollerUserData.php on line 33
what should i do sir. please help
when i try to sign up…Fail while sending code appear..pls help
My browser is taking forever to download the source code. Infact, it is just showing "The file will start downloading in 30 seconds time", but nothing happens after the said 30 seconds.
Another thing, do you have a tutorial on how to auto arrange popular Posts using post hits/visits, and configuring social media sharing buttons
your the best
how can you enable localhost on chromebook
Failed while inserting data into database! help me pls
is don't work for but y say fail to connect database can you help me pls
Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:XAMPP1htdocsloginformcontrollerUserData.php on line 33
Signup Form
Please create database and table name with the mentioned names.
Please create database name and table name with mentioned names.
Means..?
Thank you 🙂
Make sure you have configured you XAMPP and google account properly.
Can you please tell me in which blog post you get this problem so I can solve it.?
Bro You Might like wala Section main Ads nhain Lag raha kindly help me. ADS kis trha lagaon
Thank you for your great work. It's very perfect until the forgot-password & resend code. Could you explain how to make it work?
Hi, I have been getting this errors this errors frequently "Failed while inserting data into database!"
I think The problem is from the data_check, I have tried selecting before inserting, but unto no avail, kindly help check the code again. Thanks
Warning: mail(): Failed to connect to mailserver at "localhost:8080" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:xampphtdocsTDM202grcontrollerUserData.php on line 118
Warning: mail(): Failed to connect to mailserver at "localhost:8080" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:xampphtdocsTDM202grcontrollerUserData.php on line 33
nice work bro…thank you
You're welcome bro 🙂
This error mainly shows if your database, table, column names not matched with your coding php files. So please check it.
I've added forget password link also..please download files and check it.
Bro thoda theme me jake html ka code me change karna padta he…Instagram pe contact karo batadunga.
bro I want ask you if you are familiar wit javascript and php if you have time of course abut a little trick I don't know how to do it
How to download this file bro
Bro there are no tricks…It's all about learning bro.
Hi, why i can not get the verification code posted into my email? Can you explain it to me please?
how to configure wamp for forgort password and email verification
thank u…. but now how i can say when user login user can see comment. but when user do not login user can not see comment. please help.
Hi, i do have a question.
How long does it take to get the verification code posted into my email?
Thnx so much beast!
I have a question. Is this method safe ?
It is saying failed while sending code! What to do?
Hi!
Have you posted the video "How to configure XAMPP" on youtube yet.
If yes please send me the link cuz i can not find it.
Amazing site I have never visited like your site that working for others without ceasing thank you alot.
hi bro
please do video on user id generation(id=10001) generation and login with there userid
Bro makes a tutorial about mobile phone verification. Please bro
how to solve this problem
"Failed while sending code!"
I didn't received the email verification. I already configured xampp server. do I need to change the email from the code with email that I used when configured xampp?
how to connect gmail with code on 000webhost
I'll try to make a separate video for it.
Yes do that.
Please read this blog carefully
Ok bro..I'll try to make video on it
Ok bro…Stay tuned
Glad to hear that 🙂
Here is the link of that blog – https://www.codingnepalweb.com/2020/09/how-to-configure-xampp-to-send-mail-from-localhost-in-php.html
Please check out this blog – https://www.codingnepalweb.com/2020/09/how-to-configure-xampp-to-send-mail-from-localhost-in-php.html
No it's not safe at all
Between 5 to 10 seconds
I'll try to make video on it
Same as like XAMPP
You have to configure your XAMPP. Check out this blog – https://www.codingnepalweb.com/2020/09/how-to-configure-xampp-to-send-mail-from-localhost-in-php.html
Hi, i think i do not have SENDMAIL.INI FILE in my xampp folder… can not find it. I use macOS. Can you help me with this problem? 😀 Thnx so much
there is no log out form please help me
i have got everything alright, but can not get the verification code posted into my email, just wtf?
i waited 2 days and still nothing 🙁
how to solve uncaught typeERROR in php
When ?
Please read the blog carefully
Make sure you have configured your XAMPP
Please download code files instead of copying codes
It is…Please search in your folder or google it to find
Hi, SUPER TY. All work fine. Can you help me with this?, Im trying put this function for encrypt the password.
function l2j_encrypt($password){
return base64_encode(pack("H*", sha1(utf8_encode($password))));
I encrypt the password in (signup-user.php / new-password.php). But, I can't use the password with this encrypt here (login-user.php). TY again <3, im wait for your answer.
Thanks
Hello, I have uploaded this script to hostinger. after registration, email is failed to send and no options for smtp details. could you configure that?
I'll solve this and update the codes as soon as possible
You're welcome
You have to verify or compare user password with SHA because your DB passwords are encrypted and when user try to login, his/her password is in plain text so you've to compare it with SHA. I recommended do not use SHA. It can decrypt easily. Use password_hash.
in user data control it cam error.
What's the error?
how can i see my website?????
Means?
what is the solution for "error while sending the code"?
Hello sir i am using infinity hosting how can i use this login page on my website please tell sir
Thank you so much, this artikel help me finish the task 🙂
i have the same problem
Sir big fan,
You are blessed with creative mind.
Love from India
I think Coding Nepal bro has made his website in blogger.com.✅
I don't see logout.php file?
Felt really good to know that we have such talented people in Nepal. Good going bro. Best wishes.
works perfectly. but still didn't recieve any mail. xampp is configured and all but i still didn't receive the code in my gmail. followed other's suggestion like enabling IMAP in gmail setting and less secure. still didn't recieve the code. any suggestions?
is there a tutorial for Codeigniter 3, sir?
I also loved the tutorial bro!
which file should i paste the last php code? should i make another file? what name?
Hey Bro! Nice Work!
I want to ask that can we connect this to html site?
Like After Complete signing up, redirect to html site? Is It Possible Or We Need PHP Site?
please reply.
BTW THANKS FOR AWESOME STUFF
brother cpanel mai setup garda chai k garnu parxa hola? detailed bandinus na
Can you please make these scripts with PDO (prepared elements)? I'm using this for my school project, and my host needs scripts with PDO.
Thanks! Your code helped, but I'm afraid that I need to ask this little favor of yours again.
tutti
Is it possible to put this online? How?
hi how can i use the code just to show the error messages without sedning an email with the token etc
hi how can i just use this code without the sendmail and the token functions. I just want the feature to check for the errors
otp code not sent to the email…pls help us fixed this
Hi Coding Nepal, all your codes works so well! and it has helped along the way! But now Is there to make this like a membership system. I need your help on that.
hi what does this mean?
Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:wamp64wwwportalcontrollerUserData.php on line 33
Hello bro, how can users get the confirmation code in their emails? I have tried but seems a dead end from side… I am using iCloud mail.
can you please help me
Excellent post, many thanks for this great information.!
Thank you so much 🙂
Thank you so much for your appreciation 🙂
I did was change my email in the controllerUserData.php and configure xampp settings, still getting the error alert: Failed while sending code!
Did you configure your XAMPP??
Yes, It don’t work
Otp Email Is Not Coming , I Am Using 000webhost . And I Used Gmail Address .
Hi, this is only for localhost, and for the online server you have to edit config file details with server details.
where i will get this config file
It’s inside the project folder and you can download it from the given download button.
It dont send a email for the code
Make sure you’ve configures your XAMPP
email stopped working
Make sure to configure XAMPP
It’s only working in XAMPP or also working in wamp server?
You guys are the best pls is there any tutorial on how to create a login form/registration form that when the user enters a specific code it registers the user and will lead the user to a page where he can save files and get those files back pls help me out am a new developer and finding it difficult
No, still we have no such kind of tutorials.
is there anyway to configure it to wampp server please let me know i love your coding tutorials please solve my problem
Hello, I’m really sorry because I haven’t used wamp so please install xampp and follow the steps for this login form.
if yes please let me know the configuration, if no then what steps i need to follow , as i don’t have xampp if you need me to install it i will do it or any other solution except installation please provide i am waiting
joo it don’t send a email
What kind of email or which email(sender) writing in the code for sent otp
You are the best
HI can you integrate this with a responsive design please…
Hii please help me I am student and I am learning it.
Querry: When I sign-up in this it’s show unable to send data into database and too many errors I am unable so solve it please help me. and Make Video on how to create My SQL database and connect database to this login, sign-up system please reply me. and make video I am waiting for you.
Maybe, your config file database name is not matched with your database. Please read the blog for it.
Bro you are great I am big fan of you, I always had a dream to learn coding from you
Hope your dream comes true.
adblocker popupkeeps comming i dont even have a extension on my browser it doesnt even work on private mode
I’m really sorry for this but please make sure ads are showing on this site because your browser may have blocked the ads.
your code works fine on localhost, but on live server it was showing error on signup “failed while inserting data in database”. i am using namecheap hosting where creating new database will save db name as “diamqpuj_userform” and not how i want “userform” and it saves username like that as well. i did change my connection file with db name as “diamqpuj_userform” same with username as well but still it is showing error don’t know why.
hey codingNepal pls tell like if i add this page i want that after all these steps my original website opens…how to do that?
Could you please show about phpmyadmin setup for this form? Like how to place otp and verification status from phpmyadmin
Please, read the blog properly. You don’t need to set up or create a database for this login form. I already provided a SQL file that creates a required table, columns.
Hello
first of all i will like to appreciate your work. You are doing a great and awesome job. Thank you.
Now my question: How can remove the otp verification option form the form?
omg you are soo good at coding i feel jealous of you!
Thanks a lot for the source code sir, everything is working properly but only one thing is showing error , and that is “forget password” option.
in that after entering the email ,when i click on “continue” it shows error .
The requested URL was not found on this server.
Apache/2.4.48 (Win64) OpenSSL/1.1.1k PHP/8.0.9 Server at localhost Port 80
can you plz help me in solving that ?
rest of the files are perfect
Can i use this codes on my website? i will give credits at the bottom.
I will style these forms as much as i can just i need the php codes for i know a bit php but not so much advanced php and i was looking for sth just like this
Yes, you can use it.
Hi bro codingnepal I saw your video but I have confused because I saw two different videos of sending email messages and they’re 1:mail ()function
2:smtp,
So what are the difference between these two methods
hi there are multiple PHP files which one should I use?
Please, read the blog for it.
hei how to make sql database usertable please tell me
Always when I used to search any coding at last I used to put coding Nepal because here everything is like beautiful and I like this website one day I will make a video about this but this website will be treasure to you and me at finally with fun I really enjoy it with myself you also search anything by here defiantly you can gain an understanding mode hope this enjoyment is great
I appreciate your comment. Keep visiting <3
It works! Thank you for your hard work. Appreciate it!
You’re most welcome
Why it doesn’t send a OTP in my email address but the code is available in the server and if i use the test.php file it can send the message “Hi, there…This is a test email send from Localhost.” to the email. Is the controllerUserData.php code has the problem?
Thanks for your work here, I’m working on live server how can I use use the smt it doesn’t;t send mails on live server
It does not work on a live server. You have to download xampp for it.
Hello and thank you for a super tutorial.
Can you help me to add a timpstamp/expiration time for the OTP?
Thank you.
Okay, I’ll think about these changes.
how to link my home page in login form any one help pls…
helloo bro
you have a wondeful project but i have tried to use it on one of my html website but it gives me error pls can you just write to me how to do that or integrate if its possible please i am pleading in the name of God please”’thanks…
Can tell me what was the error?
Hi I downloaded your project it works good. However I tried changing around stuff on the css page like background color and stuff but when I save and reload the content doesn’t change on the html page. Do you know why ?
Clear the caches, cookies and try again.
It’s working properly.
Thank you.
Helpful
Hi Bro Impressive Work, I have used these scripts for a long time and it working on a local and live servers with a little tweak.
Can you add csrf protection in the next version and when will your next versin be out?
Create Video on creating database for this project
Because when i click on sign up button it says – Failed while inserting your data into database
Please…
did u find solution ?
How to send verification email on live server with user signing up forms.
Thank a lot sir, for providing a important codes.
Hello i own a webserver how do i config the smtp the email on cpanel?
Hello,
Everything works perfectly with Mysql and my web server. I was able to customize the colors and translated into French all the pages. On the other hand, when I try to translate “notverified” and “verified” by “non” and “oui” in the file “controllerUserData.php”, the email sends me the verification code and after having added it and weighed on the button, it still asks me for the code and I can not go further in the operation.
Can you help me?
Thank you for this wonderful system.
From Québec, Canada
You are the best @CodingNepal.. Thank you for this wonderful blog and for releasing your source code…. Much love from Nigeria
You’re most welcome <3
Please how can I password protect the user profile settings page after login, where the user have to enter their registered password only, without username or email to gain Access
Hi, i cant find the code file download in this page
would you assist pls
Thanks
At the bottom of this post, there is a blue button labeled “Download Code Files”
Can it work on live server?
how to configure the smtp mail on a php server not XMAPP please help me.
CAN WE HOST THE WEBSITE DEVELOPED USING SAME LOGIC? DO WE FACE ANY PROBLEM??
I have successfully configured the files and the smtp settings in xampp. Now it says the verification code has been sent to the email but no verification code is received? Can you please help me out here
Is this program will work if I web hosted it?I mean the email verification
Hey there CodingNepal, this is awesome! But I have a problem. I keep on getting errors even though I started both Apache and MySQL on xampp and I made the userform table and imported the file. Could you do a video on making this whole login and signup system? It would be great help. Thanks.
How to Set Google ReCaptcha In Your Login & Signup Form with Email Verification using PHP and MySQL PHP.
Please Help Sir.
Hey This is great THANK YOU!
?php require_once “controllerUserData.php”; ?>
THIS WORK?~
IS this correct for the other pages I want to control access to?
where the source code?