PHP Login & signup website with basic Security | MYSQL, CSRF tokens, prepared statements & more

preview_player
Показать описание
Learn some basic security when creating a login and signup system. we cover prepared statements, input sanitizing, CSRF tokens for your forms, folder structure, htaccess to restrict folder access and much more.
Playlist:

00:00 - Introduction
02:20 - Topics
03:30 - Folder structure
08:00 - Htaccess file
10:45 - Frontend validation
22:00 - Backend Validation
26:45 - Basic regex
38:00 - Sanitizing inputs
40:00 - Mysql database
42:00 - Database connection
50:00 - Adding some functions
53:30 - Query troubleshoot
1:01:00 - escape function
1:06:00 - Prepared statements
1:20:00 - Login page
1:38:00 - Check login function
1:45:00 - Logout page
1:52:10 - Vague error messages
1:54:30 - Error reporting
1:57:00 - HTML escaping
2:02:25 - CSRF tokens
2:13:00 - Ending

#WEB_SECURITY #LOGIN #PHP
Рекомендации по теме
Комментарии
Автор

I was expecting to see password_hash here. No one I seen has ever used this function with ANY tutorial I have watched in the past 5+ years. It is so simple to use than the unsafe MD5. You did not use any password hashing here at all. This is a VERY simple process to include yet no one does.. But I loved the demonstration of the tokens. That was very cool and easy to understand. I need to get back to my PHP Security Mastery classes.
In case anyone was wondering: You have the $password = password_hash($password, DEFAULT_PASSWORD) { //reset of inserting user data } -- Then in your login script you run a statement to fetch the user information based on $email or $username, with your array you do password_verify($password, $data['0']['password']) { //rest of your login code if true }. Of in the case with this example $data['password'] because the $data = $data[0]; first dataset in the array is already set for you.

krillinsworld
Автор

I love your videos! As a self-taught software developer your videos have helped me so much. Keep the videos coming!

Cupid_Codes
Автор

The best tutorial I have ever encounter on YouTube… pls I wish to be your student, am newbie in programming

pha_mous
Автор

Thank you for all the lessons and courses, but the most important thing is the background music. Do not let me focus. Please do not use any background music. Thank you.

pythonlife
Автор

Hongera Sana nakupata kutoka morogoro Tanzania

Gongatz
Автор

It's been a long time since I programmed anything and this tutorial is brilliant, reminded me of those little page / site code snippets to enhance security. I'll be learning from the other videos on your channel also. Cheers!

jsmithtraveller
Автор

Learning php has become fun cos of your tutorials. Thanks a lot <3

navjotsinghDhanoa
Автор

Loving your channel. Specially about this security. Great work!

ca
Автор

You make it so easy to follow along and understand. I really appreciate your videos! They have helped me so much!

jNRoss
Автор

Thank you for your time and effort! For a 2-hour video, it took me much, much longer to imitate and get to work correctly. But I learned a lot...especially fixing my mistakes. Really enjoyed your presentation style. Made my day(s)!

robertshirck
Автор

Thank you very much. I have learned a lot from your videos. It's good that you show different programming methods during the course, and indicate which one is the best. Keep up. All the best.

A_ALI
Автор

These videos are awesome ! You are fun to listen to and explain things well. I really enjoy watching your videos - thanks for putting time into them.

secretmezzanine
Автор

At 1:36:03, the null coalescing operator can be used to echo an empty string if the post variables aren't set yet. Example: value="<?= $_POST['username'] ?? "" ?>"

abdomahmoud
Автор

can u share the source code for this. thanks will be easy for us as we learn
Very good lessons

mosesgitahi
Автор

Great video, please keep up the good work! Security is not covered enough in this day and age. Sub'd.

renegade
Автор

<style> tags can be anywhere in the HTML Document. However, it is best to have it inside the <head>

harmonreiner
Автор

Escape using htmlspecialchars in the values part.

error
Автор

Amazing video! Cant stop coming back on this video. Please make more on security of web application implementation. ❤️

ca
Автор

thank you for the video, it helps me to understand the security principles on web pages

LukasKL
Автор

bro good Job, i really love PHP because of its simplicity, but when it comes to security 🥺🥺

kensyjolicoeur