Signup and Login with PHP and MySQL

preview_player
Показать описание
Learn how to create signup / registration, login and logout using PHP, MySQL and best practices.

Please consider supporting my channel:

Recommended hosting:

In this video you'll learn how to:
• create a signup page
• validate the data on the server in PHP
• save the signup data to a MySQL database using PHP
• create login and logout pages
• validate the data in the browser using JavaScript
• validate the email using an Ajax request

Code shown in the video:

Relevant documentation:

00:00 Introduction
00:23 Signup form HTML
03:24 Add classless CSS
04:04 Process form in PHP
05:12 Server-side validation
08:33 Hash the password
09:59 Create the MySQL database
11:36 Connect to the database from PHP
14:27 Insert a new record
17:00 Prevent duplicate emails
18:55 POST / Redirect / GET
20:33 Login form
21:53 Process the login form
24:45 Verify the password
27:45 Use the session for login
28:10 Add index page
30:42 Add logout page
32:22 Show logged-in user's name
34:30 JavaScript signup validation
37:35 Custom validation
39:20 Remote validation
42:49 Summary

#PHP #MySQL #signup #login
Рекомендации по теме
Комментарии
Автор

This has got to be the best php tutorial on YouTube. I really appreciate your work Dave! keep going.

cosmonautilus
Автор

This tutorial...
Just wow...
I don't know how to code as I am in the Network Admin side of IT, but with this tutorial I as able to run my very first programming page.

lincolncardines
Автор

I second the vote about being the best php tutorial on YouTube. I'm still confused (born that way) about the validation of the information before being written to the DB.

dannyreg
Автор

This HAS TO BE the best tutorial I’ve seen on this subject. Excellent and thank you.

Oletechiegirl
Автор

The comments in here mentioning your clear and quality message in this video were dead on. I haven’t touched PHP in years and only recently MySQL for a personal project. You connected neurons that haven’t engaged in ages, your delivery style is so good. Liked and subbed and would definitely love to learn more from you.

EricsWormPlayground
Автор

i'm a beginner at php and i found this extremely clear and easy to understand! thank you so much!

salma-amlas
Автор

I've been struggling for days on how to setup php on my website and you just made everything clear in 45 minutes. Cheers!

samuelrichard
Автор

Hi Dave! Starting as a Web Dev intern soon, and I just wanted to say, how great and informative these videos are for understanding "what's under the hood" so to say. Keep up the amazing work!

nnzzz
Автор

I never found someone who explains the way you do. Thank you very much.

DavidEMunozR
Автор

one of the video that got me understand, i've watched 5-more videos, and this is clear. tommorow is deadline for university assigment and my lecturer never teach php

ayam
Автор

What other topics would you like to see a video on? Please let me know!

dave-hollingworth
Автор

This is part 1. Part 2 is here: PHP Password Reset by Email:

and part 3 is here: PHP Account Activation by Email:

dave-hollingworth
Автор

Man, I thought the thumbnail of your video was a creepypasta, but u really help me to understand the topic.

davidrangel
Автор

You are a great Teacher!!!
This is the best php tutorial i've seen. There are so many tutorials where you can't understand what about they are talking.
Your tutorial is step by step, so clear and easy to understand. I must watch all your videos...
Thanks a lot!!!

NetReklam-omds
Автор

For anyone having issues at 18-19 minutes with Fatal error uncaught SQL exception,
instead of using if ($mysqli->errno === 1062), you can use a try, catch block like:
try {
$stmt->execute();
} catch (mysqli_sql_exception $e) {
if ($e->getCode() == 1062) {
die("email address is already taken");
}
}

ulti_matt
Автор

I have just discovered this wonderful tutorial of PHP. Incredible. Thank you very, very much!!!

zbysiu
Автор

You are a great lecturer your code helped me

frankkaundamukhuni
Автор

This is the best PHP tutorial on YouTube!
❤️❤️❤️❤️🤜🤛

emmanuellyons
Автор

WOW! I always want videos like this. You do an amazing job. Thorough explanation on why each code block is chosen. How to test implementation along the way. And a full video from start to finish comprehensively solving the entire subject at hand. Thank you for your dedication to excellence and kindly sharing it with the rest of us.

retrorusty
Автор

I think this video is one of the best tuturial of creating the registration form in youtube.

saeidvaygani