Playback starts YouTube’s embedded player (privacy-enhanced mode).
How To Create A Login System In PHP For Beginners | Procedural MySQLi | PHP Tutorial
ChannelDani KrossingChapters
Description from the creator
In this PHP tutorial you will learn how to create a login system in PHP from, and how to show content after being logged in. You will also learn about error handlers, and MySQL databases, which includes how to make a login form and a signup form. If you get any errors during this tutorial, make sure to check out my solutions at the very bottom of this description! :)
➤ LINKS
User Profile Page video (READ FIRST):
I decided that it would be better to create the Profile Page using Object Oriented PHP (OOP), instead of Procedural PHP. 🙂
OOP is MUCH better for creating BIG systems in PHP, and is more organized and considered the "proper way" of writing PHP.
I have a OOP Login System tutorial that I will link bellow, that I recommend you watch after this one. 🙂 And I will also link my OOP PHP course in case you are completely new to OOP PHP. 😉
Even though you can still follow along on the OOP Profile System video right after THIS Procedural Login System tutorial, I strongly recommend that you watch the OOP Login System first... Since it will be easier to follow along. 🙂
OOP PHP Course: youtube.com/watch?v=Anz0ArcQ5kI&list=PL0eyr…
OOP Login System tutorial: youtube.com/watch?v=BaEm2Qv14oU&ab_channel=…
OOP Profile Page tutorial: youtube.com/watch?v=SfE_bXFQmCU&ab_channel=…
Install XAMPP & a local server: youtube.com/watch?v=mXdpCRgR-xE
Regular expressions (search patterns): youtube.com/watch?v=In5NBIRfMrQ
PHP Password Recovery System: youtube.com/watch?v=wUkKCMEYj9M
➤ CHAPTERS
00:00:00 - Introduction
00:01:16 - How to get my lesson files
00:02:11 - What will you learn in this video?
00:02:48 - What security will we use?
00:03:41 - It's Procedural PHP, not OOP PHP
00:04:14 - If you get a error along the way...
00:04:48 - A demonstration of what we will make
00:08:20 - What YOU should have ready before we start!
00:12:52 - Creating our Header and Index pages
00:15:57 - Creating our Signup and Login pages
00:26:43 - Creating a connection to our database
00:33:16 - Creating our database
00:42:23 - Creating our Signup script
00:58:23 - Creating our Signup functions
00:58:23 - Testing our Signup system
01:24:46 - Creating Signup page error messages
01:26:47 - Creating our Login script
01:36:35 - Creating our Login functions
01:46:22 - Creating Login page error messages
01:47:47 - Changing our website when user is logged in
01:51:19- Testing our Login system
01:52:20 - Creating our Logout script
01:54:12 - Creating a welcome message when logged in
01:54:44 - Outro
➤ GET ACCESS TO MY LESSON MATERIAL HERE!
First of all, thank you for all the support you have given me!
I am really glad to have such an awesome community on my channel. It motivates me to continue creating and uploading content! So thank you!
I am now using Patreon to share improved and updated lesson material, and for a small fee you can access all the material. I have worked hard, and done my best to help you understand what I teach.
I hope you will find it helpful :)
Material for this lesson: patreon.com/posts/lesson-material-42361704
➤ ERRORS YOU MIGHT RUN INTO!!!
▸"signup=empty"
Make sure you wrote "mysqli_connect" and NOT "mysql_connect" in the dbh.inc.php file!
▸"unexpected }"
If you get this error message:
Parse error: syntax error, unexpected '}'
Then it is because you forgot to close a ) or ; somewhere.
▸"unexpected ;"
If you get this error message:
Parse error: syntax error, unexpected ';'
Then it is because you forgot to close a } or ) somewhere. Probably because you made a mistake with your parenthesis near the "empty()" functions in your signup script.
▸"hashed pwd error"
If you get an error in the script when you hash the password, then it is because you decided not to follow my steps exactly in the video when I created the database table. Make sure you DON'T set the varchar() to a lower value! When you hash the password it will take up a lot of space in this column, and if you set a lower number then it won't fit!
▸"signup=success but database is empty?"
Here there might be a few reasons for your error. 1st is that you made a syntax/spelling mistake in your code. And yes you will claim that your code is identical to mine, but in 90% of the cases people claim this, I still find a syntax error in their code. So check your code for errors!
2nd reason is that MAMP seems to cause a lot of issues for people. Therefore try using XAMPP and make sure you write the same as me in the dbh.inc.php file.
3nd reason might be because you didn't follow the tutorial 100% when we set up the database at the beginning.
▸"HTTP ERROR 500"
HTTP ERROR 500 is a server error, meaning that you are most likely using an outdated version of apache or mysql. Try updating your servers and make sure that you are using the latest version of PHP.
➤ LINKS
User Profile Page video (READ FIRST):
I decided that it would be better to create the Profile Page using Object Oriented PHP (OOP), instead of Procedural PHP. 🙂
OOP is MUCH better for creating BIG systems in PHP, and is more organized and considered the "proper way" of writing PHP.
I have a OOP Login System tutorial that I will link bellow, that I recommend you watch after this one. 🙂 And I will also link my OOP PHP course in case you are completely new to OOP PHP. 😉
Even though you can still follow along on the OOP Profile System video right after THIS Procedural Login System tutorial, I strongly recommend that you watch the OOP Login System first... Since it will be easier to follow along. 🙂
OOP PHP Course: youtube.com/watch?v=Anz0ArcQ5kI&list=PL0eyr…
OOP Login System tutorial: youtube.com/watch?v=BaEm2Qv14oU&ab_channel=…
OOP Profile Page tutorial: youtube.com/watch?v=SfE_bXFQmCU&ab_channel=…
Install XAMPP & a local server: youtube.com/watch?v=mXdpCRgR-xE
Regular expressions (search patterns): youtube.com/watch?v=In5NBIRfMrQ
PHP Password Recovery System: youtube.com/watch?v=wUkKCMEYj9M
➤ CHAPTERS
00:00:00 - Introduction
00:01:16 - How to get my lesson files
00:02:11 - What will you learn in this video?
00:02:48 - What security will we use?
00:03:41 - It's Procedural PHP, not OOP PHP
00:04:14 - If you get a error along the way...
00:04:48 - A demonstration of what we will make
00:08:20 - What YOU should have ready before we start!
00:12:52 - Creating our Header and Index pages
00:15:57 - Creating our Signup and Login pages
00:26:43 - Creating a connection to our database
00:33:16 - Creating our database
00:42:23 - Creating our Signup script
00:58:23 - Creating our Signup functions
00:58:23 - Testing our Signup system
01:24:46 - Creating Signup page error messages
01:26:47 - Creating our Login script
01:36:35 - Creating our Login functions
01:46:22 - Creating Login page error messages
01:47:47 - Changing our website when user is logged in
01:51:19- Testing our Login system
01:52:20 - Creating our Logout script
01:54:12 - Creating a welcome message when logged in
01:54:44 - Outro
➤ GET ACCESS TO MY LESSON MATERIAL HERE!
First of all, thank you for all the support you have given me!
I am really glad to have such an awesome community on my channel. It motivates me to continue creating and uploading content! So thank you!
I am now using Patreon to share improved and updated lesson material, and for a small fee you can access all the material. I have worked hard, and done my best to help you understand what I teach.
I hope you will find it helpful :)
Material for this lesson: patreon.com/posts/lesson-material-42361704
➤ ERRORS YOU MIGHT RUN INTO!!!
▸"signup=empty"
Make sure you wrote "mysqli_connect" and NOT "mysql_connect" in the dbh.inc.php file!
▸"unexpected }"
If you get this error message:
Parse error: syntax error, unexpected '}'
Then it is because you forgot to close a ) or ; somewhere.
▸"unexpected ;"
If you get this error message:
Parse error: syntax error, unexpected ';'
Then it is because you forgot to close a } or ) somewhere. Probably because you made a mistake with your parenthesis near the "empty()" functions in your signup script.
▸"hashed pwd error"
If you get an error in the script when you hash the password, then it is because you decided not to follow my steps exactly in the video when I created the database table. Make sure you DON'T set the varchar() to a lower value! When you hash the password it will take up a lot of space in this column, and if you set a lower number then it won't fit!
▸"signup=success but database is empty?"
Here there might be a few reasons for your error. 1st is that you made a syntax/spelling mistake in your code. And yes you will claim that your code is identical to mine, but in 90% of the cases people claim this, I still find a syntax error in their code. So check your code for errors!
2nd reason is that MAMP seems to cause a lot of issues for people. Therefore try using XAMPP and make sure you write the same as me in the dbh.inc.php file.
3nd reason might be because you didn't follow the tutorial 100% when we set up the database at the beginning.
▸"HTTP ERROR 500"
HTTP ERROR 500 is a server error, meaning that you are most likely using an outdated version of apache or mysql. Try updating your servers and make sure that you are using the latest version of PHP.
About this tutorial
Dani Krossing published this 1:57:38 video tutorial on October 12, 2020. It has been watched 1,218,395 times on YouTube.
- Channel
- Dani Krossing
- Category
- Education
- Duration
- 1:57:38
- Published
- October 12, 2020
- Views
- 1,218,395
- Likes
- 18,909
Tags
Share
This tutorial in other languages
- FRComment faire pour créer un système de connexion en PHP pour les débutants | MySQLi procédure | PHP Tutorial
- ESCómo crear un sistema de acceso en PHP para principiantes | MySQLi de procedimiento | Tutorial PHP
- PTComo criar um sistema de login em PHP para iniciantes | MySQLi processuais | PHP Tutorial
- ITCome creare un sistema di accesso in PHP per i principianti | MySQLi procedurali | PHP Tutorial
- DEWie man ein Login-System in PHP für Anfänger erstellen | Procedural MySQLi | PHP Tutorial
- NLHoe maak je een login-systeem In PHP voor beginners | Procedurele MySQLi | PHP Tutorial
- RUКак создать Войти системы, в PHP для начинающих | Процедурные MySQLi | PHP учебник
- PLJak stworzyć systemu logowania w PHP dla początkujących | MySQLi proceduralne | PHP Tutorial
- JAAログインシステムではPHPのために初心者を作成する方法|手続きMySQLiを| PHPチュートリアル
- ARكيفية إنشاء نظام الدخول في PHP للمبتدئين | MySQLi الإجرائي | PHP دروس
- HIमें पीएचपी के लिए शुरुआती एक लॉग इन सिस्टम बनाने के लिए कैसे | प्रक्रियात्मक MySQLi | पीएचपी ट्यूटोरियल
- IDCara Membuat Login Sistem Dalam PHP Untuk Pemula | MySQLi prosedural | PHP Tutorial