HomeЛюди и блогиRelated VideosMore From: Awa Melvine

Login system using PHP with MYSQL database

6978 ratings | 3499797 views
UPDATE: User registration with email verification on localhost: https://goo.gl/nRADcM In this login video, I create a users table with fields id, username, and password. Then I inserted a user whose credentials I used to log in. *** Learn how to build a complete blog with PHP and MySQL: https://goo.gl/Ru41Tw - - - - - - - - - - - - - - - - - - - C O U R S E S - - - - - - - - - - - - - - - - - - - { B O O T C A M P S } - - The Web Developer Bootcamp: http://bit.ly/2NpDcKR - - The Complete Web Developer in 2018: Zero to Mastery: http://bit.ly/2N0ZW4F { P H P } - - PHP for Beginners - Become a PHP Master - CMS Project: http://bit.ly/2u5QMIw - - Create a REAL Social Network like Facebook in PHP + MySQL: http://bit.ly/2wUv3om - - PHP with Laravel for beginners - Become a Master in Laravel: http://bit.ly/2QcbeRf - - PHP OOP - Understand Object Oriented Programming in PHP: http://bit.ly/2CysNs3 { P Y T H O N } - - Complete Python Bootcamp: Go from zero to hero in Python 3: http://bit.ly/2wSybRs - - Complete Python Masterclass: http://bit.ly/2oNWfQW { J A V A S C R I P T } - - Modern JavaScript From The Beginning: http://bit.ly/2wUHdwD - - The Complete JavaScript Course 2018: Build Real Projects!: http://bit.ly/2wUlZ1L - - Modern React with Redux: http://bit.ly/2QcWBx0 - - MERN Stack Front To Back: Full Stack React, Redux & Node.js: http://bit.ly/2CAaeDY
Html code for embedding videos on your blog
Text Comments (724)
Awa Melvine (2 months ago)
✔✔✔💥UPDATE: Here is a better version of this video: https://youtu.be/ShbHwaiyOps UPDATE: User registration with Email verification: https://www.youtube.com/watch?v=8K4Wt37Itc4
Asmaa Ghoniem (2 months ago)
can I use this for android studio
Класс!
Portal Músicas M.R.A (2 days ago)
gostei
Killersponge87 (5 days ago)
This login is easy to bypass. If a empty post-body is sent, then it won't find a row in the database. This let $row['username'] be undefined, like $_POST['username'], too. So you're able to login with an empty post-request. There is also no reason for comparing the post with the databse result, because if the user / password - combination is invalid, then the database will find no row and the function mysql_num_rows() returns 0. Then some thinkings. It's a real good option to use PDO. Because the c-style mysql api is deprecaded and was removed in php 7. With PDO it's possible to use prepared statements for re-using queries and for letting the database escape the user input.
Malik Malik (5 days ago)
bio-data form using html WITH SOURCE CODE.DOWNLOAD IT FROM DESCRIPTION ......https://www.youtube.com/watch?v=k0i4ZDlddlw
Kiarash Bahrami (5 days ago)
try 1.5x speed
Ben Abe (6 days ago)
the code is not safe. SQL injections are possible. is better to use escape functions to make the user input safer. mysql_real_escape_string()
Manisha Prasad (8 days ago)
thanks..it helped me out
W R (10 days ago)
bom dia tenho um projeto aqui em casa com arduino uno para abrir o portão de casa pelo celular, agora quero colocar a minha camera do dvr intelbras na mesma tela. para quando eu ver a camera poder apertar o botão do portão. mais não estou conseguindo, pois não consigo dar player no rtsp . o que eu faço ???
ChaT [Official Lyrisc] (13 days ago)
4T5 Rap has shared a video with you on YouTube: “How to Read RSS Feed in PHP” — Learn How to Read RSS Feed with PHP. How to display XML RSS Feed by using PHP...
Aron Hargrove (13 days ago)
you are 6 years late for text tutorials bud, thanks for the laugh! :)
Guillermo A (13 days ago)
Hey Ian I am not familiar with the new Javascript syntax, what resource would you recommend to a person that is taking the web dev boot-camp course and wants to know how to write new javascript syntax and see how it is written now compared to before? also, another question, if a potential employer sees our version of yelp camp written with old javascript syntax from the course, would this be viewed negatively? thanks in advance brother.
diordiev ivan (14 days ago)
BITSLER Я дам для тебя в уста!!!! Ты заебала меня наебывать сука паршивая!!!!
diordiev ivan (14 days ago)
BITSLER Я дам для тебя в уста!!!! Ты заебала меня наебывать сука паршивая!!!!
Arpit Suman (15 days ago)
for database named ---- webproject and table named ----- register <?php session_start(); $username = ""; $password = ""; $db = mysqli_connect('localhost', 'root', '', 'webproject'); if (isset($_POST['user'])){ $username = mysqli_real_escape_string($db,$_POST['user']); $password = mysqli_real_escape_string($db,$_POST['pass']); $result = mysqli_query($db,"select * from register where username = '$username' and password = '$password'") or die("Failed to query database ".mysql_error()); echo "$password"; $row = mysqli_fetch_array($result); if($row['username'] == $username && $row['password'] == $password) { // echo "Success!".$row['username']; header("location: home.html"); } else { echo "failed to login"; }}
Cloud Token Reviews (15 days ago)
Great stuff Ryan. Thanks for taking the time and effort to lay it all on the line!
Lifa Journey (17 days ago)
hai awa melvine ... very inspired sir.
DRAGONslayer043 (19 days ago)
Bruhhhhhhhhhhhhhhhhhhhhhhhhhhhhh, how slow do you tyyyyyppppeeee godddaammmnnn.
KunMail (19 days ago)
Free themes available here that anyone can download. https://www.kunmail.com/
весьма пользующаяся популярностью тема, ждем уже релиза
Nick Thayne (20 days ago)
Insted of video's why don't we gain millions of people. to insist that anyone holding public office (president of us) to be evaluated not only Physically, but Emotionally as well as Mentally N.
Geri (20 days ago)
Uncaught Error: Call to undefined function mysql_real_escape_string() in C:\xampp\htdocs\login\process.php:9 Stack trace: #0 {main} thrown in C:\xampp\htdocs\login\process.php on line 9 If anyone could help, I would thank you very much!!!
Wouter van Beijnum (21 days ago)
Do NOT use this method to create a login system. It is very unsafe. Passwords should not be stored as plain text and this implementation is vulnerable to SQL injection attacks.
Zakaria Noui (21 days ago)
thank you <3
Andrew Kassar (21 days ago)
https://easy1up.com/?id=andrew229 join me with this great opportunity!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! endless income without leaving your chair LIFE Changing
pushkar arora (21 days ago)
In this data in $result before using mysql_fetch_array() function is in which form ? Is it in object form?
Bolluwatifeh Ayomideh (23 days ago)
make money now I got $22:000 bitcon in my account with the help of [email protected] without issue you can contact him via WhatsApp +14356122777
Coco La noix de coco (23 days ago)
VeryGood
Hola, Podrías subir mas vídeos con otras sentencias?
Joaquin Salas Zurita (25 days ago)
ESCRIBE EN ESPAÑOL
Flavio Bueno (25 days ago)
Show!!!!
These videos without sound are so annoying. It is super boring to watch a video with no sound. Besides, it is very difficult - if not impossible - to understand what is going on when you only have the visual part. If you don't want to record your own voice, at least use a text to speech tool. If you can't even do that, don't bother making instruction videos at all. That's my opinion anyway.
Awa Melvine (25 days ago)
Hey friend, thank you for your honest opinion. This video is very old and I recorded it when I was just starting out. Here's an updated version of the video with sound: https://youtu.be/8K4Wt37Itc4 Thanks for watching!
Jundy Islami (25 days ago)
atal error: Uncaught Error: Call to undefined function mysql_real_escape_string() in C:\xampp\htdocs\login\proces.php:9 Stack trace: #0 {main} thrown in C:\xampp\htdocs\login\proces.php on line 9
Manuel Bersamina (21 days ago)
same my problem toooo
GNI Jazz (25 days ago)
mysql not work mysqli worked
With CSS hero if you change anything on the pages, does it change the CSS code across the site or just that page you are on? I would be afraid it could modify the whole site. Let me know.
AM CODE (27 days ago)
Nice#amcode
MTECH-CORP LEARNING (27 days ago)
ALl in Javascript https://www.youtube.com/watch?v=lJUZ2fLFmsQ&list=PL1LnoehcFt-1_D0DdwbmSAmnA4riSR2BF
alessandro costa (28 days ago)
https://tessline.com/en/checkin?upliner=61452940
Dim Stoin (28 days ago)
<?php // to get values passe from form in login.php file $username = ""; if(isset($_POST['user'])){ $username = $_POST['user']; } $password = ""; if(isset($_POST['username'])){ $password = $_POST['password']; } // to prevent mysql injection $username = stripcslashes($username); $password = stripcslashes($password); $username = mysql_real_escape_string('username'); <---------- $password = mysql_real_escape_string('password'); //connect to the server select database mysql_connect("localhost", "root", ""); mysql_select_db("login"); // Query the database for user $result = mysql_query("select * from users where username = '$username' and password = '$password'") or die('Failed to query database'.mysql_error()); $row = mysql_fetch_array($result); if ( $row['username'] == $username && $row['password'] == $password ) { echo "login success! Welcome".$row['username']; } else { echo "Failed to login!"; } ?> Uncaught Error: Call to undefined function mysql_real_escape_string() in C:\xampp\htdocs\login\process.php:16 Stack trace: #0 {main} thrown in C:\xampp\htdocs\login\process.php on line 16 Please help me dude!
ridhoazhar megantara (28 days ago)
suwun yo pak,wis mantab tenan lek mu nyampekne....
AumMM (30 days ago)
Parse error: syntax error, unexpected '$result' (T_VARIABLE) in D:\xampp\htdocs\YangDD\process.php on line 17 ,why still erro anyone can help?
Venkatesh Nambi (11 days ago)
u might have missed " ; " a line before it. please check that!
gabi lopez (30 days ago)
hi my name is madafaca jajajaja hablen jajaja
Lucas Melo (1 month ago)
Fatal error: Uncaught Error: Call to undefined function mysql_real_escape_string() in C:\xampp\htdocs\Login\process.php:8 Stack trace: #0 {main} thrown in C:\xampp\htdocs\Login\process.php on line 8
IamQuuick (1 month ago)
mysql_real_escape_string has been deprecated for a long time and was completely removed with PHP 7 (which is why you get the error it's not found). Use mysqli_real_escape_string instead, or PDO with prepared statements. Check the PHP documentation for more information
Wolver Hulk (1 month ago)
Got this error: Fatal error: Uncaught Error: Call to undefined function mysql_real_escape_string() in C:\XAMPP\htdocs\Login\proccess.php:7 Stack trace: #0 {main} thrown in C:\XAMPP\htdocs\Login\proccess.php on line 7 HELP?
Akmal Hakimi (27 days ago)
@Wolver Hulk could u pls share me ur codes
Wolver Hulk (27 days ago)
@Akmal Hakimi I tried changing mysql to mysqli but it said too few arguments and i looked it up i was doing everything right... pls help
Akmal Hakimi (1 month ago)
Aloysius Beronque no problem 😇
Aloysius Beronque (1 month ago)
@Akmal Hakimi Thanks alot!
Sergey Alexeev (1 month ago)
Ну выручил черномазый!
mankinwomg mankinwomg (1 month ago)
why Fatal error: Uncaught Error: Call to undefined function mysql_real_escape_string() in C:\xampp\htdocs\login\process.php:7 Stack trace: #0 {main} thrown in C:\xampp\htdocs\login\process.php on line 7 please help https://drive.google.com/drive/u/0/folders/1D7ezaEOC0tbyDDgbRpQsDuoqaty3DPVM thank you very much
Mateusz Soroka (1 month ago)
Seriously? Password as a plain text?
Excellent overview, you need to invest
evgenija kadlubiskij (1 month ago)
Интересно, приживется ли проект в данной промышленности! Вообще перспективы отличные, конечно и команда что нужно, видение решения трудности - то что нужно
Markus Studer (1 month ago)
Pelase note: Do never save passwords like this use md5 or better methods see: https://www.php.net/manual/faq.passwords.php
Advice for iDevice (1 month ago)
Oh my gosh i only saw $POST and left the video, trying to figure out what is the error for an hour... Just make $_POST ..
ForminaSage402 (1 month ago)
Lol idk why this video is in my recommended but if you use Ctrl+D in Sublime Text, it will select the next instance of the highlighted text.
Steven Smith (1 month ago)
Same issue yesterday, tech support for 30 minutes... went this morning traded in cable box, it worked for 20 minutes, Please Wait, called tech support, suggested reboot, You mean where I unplug the box, wait 1 minute, plug back in, L-9, L-8, L-3... Please Wait, scheduled a noon-1pm for Tuesday tech to come out, must tell boss my tv is more important than the job. If he had his priorities straight he would understand.
R Z (1 month ago)
I liked it.
Farisya & Faiqa Gacha (1 month ago)
Kak bagus^^
M-A (1 month ago)
good video thanks
M-A (1 month ago)
nice
Azen Kwed (1 month ago)
You should use the Netscape browser while you at it.
Alejandro Amor Puro (1 month ago)
I WANT PASS FOR PORN PAGES, CAN YOU HELP ME?
Faruk Sariyagiz (1 month ago)
Inceldigi yerden kopmazsa amk....!
TEAMRALLY (1 month ago)
wo kann ich dir privat schreiben ??
The Rapture @6W6I
Long Kim (1 month ago)
Thank You :)
Man not another notepad video
gregstandart limo (1 month ago)
I wonder how this managed to come among my autoplay list, just how? I am a fool I watched it though.
fredrick esedo (1 month ago)
yes you are
ELOI MUGISHO (1 month ago)
i like it.
Raaj Singh (1 month ago)
error on every line!
center PARS NEGIN (1 month ago)
Thanks for the videos.
Joachim Dietl (1 month ago)
Hi I am too dumb to use a microphone. If you want the source code, send a a scroll or an animal skin. We will tatoo the code on it and send it back!
VB6 Expert (1 month ago)
Dear Sir can I know the platform you are using to write the code ?
DeafeningRoar (1 month ago)
its sublime text, if thats what you're referring to.
junquan su (1 month ago)
Alibaba Cloud HI purchases cloud products for a limited time of 50%, enterprise cloud servers as low as 3 fold, network construction as low as 14/month, cloud communication as low as 0.027/bar, quick purchase! https://www.aliyun.com/acts/product-section-2019/new-users?spm=5176.11533457.1089570.2.d1b177e39Y7hX4&userCode=zs6vwit7
An interesting project, analogues have not met yet
Gracias, fácil y efectivo.
O 1 (1 month ago)
Trung Duong, cho minh xin link down ve nhe, cam on ban
Johnnystam666 (1 month ago)
Thank u
The USSR (1 month ago)
Doesn't hash passwords
Veerender Kumar (1 month ago)
good job. thanks
guapofill felle (1 month ago)
DEAS-W33H-CABV-VF58-2SNJ 20/07/2019 si caducan pidanme mas
Rob K (1 month ago)
you uploaded this in 2015? holy fuck, if you ever learned anything from this video I'm 100% not hiring you lol
Miguel Nogueira (1 month ago)
This video is severely outdated, unhashed passwords and old deprecated mysql extension, and old methods p.s. i know there's a better version out there
Seleman Class (24 days ago)
can't you see it was uploaded 2015...what do you expect hater?
Jessica James0596 (1 month ago)
nice
Bin Lê (1 month ago)
Fatal error: Uncaught Error: Call to undefined function mysql_real_escape_string() in C:\xampp\htdocs\ASM2\login.php:6 Stack trace: #0 {main} thrown in C:\xampp\htdocs\ASM2\login.php on line 6
Miguel Nogueira (1 month ago)
mysql_real_escape_string was deprecated. please don't use this tutorial anymore. If you're using PHP 7, it's been removed. The alternative is mysqli_real_escape_string(). But then again please don't use this tutorial as it's severely outdated and insecure. The mysql extension was removed as I stated. There are far better tutorials out there.
lolrogi (1 month ago)
Wait what? Are you storing passwords in plain text?
Nutri Tech (1 month ago)
Not working after Install dear
guilherme daniel (1 month ago)
nice
RepublicanGuard (1 month ago)
I am Iron Born. What is dead may never die!
moshe shai (1 month ago)
משה שי שמאי צקרקעין ,מתווך דירות,הולילנד נכסים ירושלים ,אפליקציה אפקטיבית לסייבר ספייס
Mustafa SAYIN (1 month ago)
Hi, I cant read strings, write is succesfully but, how can I read. thanks alot of
Mustafa SAYIN (1 month ago)
yoksa, sql de ve php de sorun yok, her şekilde veri alıp yazıyorum da, bu nasıl oldu hala çözemedim, ben de diyorum adamlar neden benim soruma cevap vermiyorlar :)
Mustafa SAYIN (1 month ago)
​@Bedirhan Dincer Eyvallah kardeş, bu arada yeni farkettim, ben bu mesajı otomasyon videosu altına yazmıştım, o arada video bitince buna geçti zaar :) valla ben de yeni farkettim, youtubenin acayiplikleri.
Bedirhan Dincer (1 month ago)
@Mustafa SAYIN Tamamdir, işe lazimsa kimse seni tutamaz ;p. Seni ogrenci sandim o yuzden dedim. Ama yinede genelde cok sirketler eski teknoloji kullaniyorlar sende haklısın. Sirket için yeni teknoloji kullanmak cok masraf.
Mustafa SAYIN (1 month ago)
@Bedirhan Dincer eyvallah kardesim. Ben de node_red ile endustriyel otomasyon yaptim. Plc ile haberlestiriyorum. Ama bazen php cok lazim oluyor. Acemiyiz daha 😀😀😀
Bedirhan Dincer (1 month ago)
Abicim @Mustafa SAYIN bu program dili cok eski orgenme. Ben avrupa'da universiteyi gidiyorum orda PHP eski olarak goriyorlar. Sorun varsa sora bilirsin. Simdik backend olarak Node.js kullaniyorlar ve Rust dili. Node.js suan daki trend ama Rust dili yeni trend olucak.
Nono Panzu (1 month ago)
Thank you very much for this tutorial: Great! Your tutorial is clearly showing how and where to create the files code and how to display them for testing in a browser, Well Done. Nevertheless, there is a problem with error handling. I just tried to do a test by entering a wrong username and password to see the result. And then it created a big issue!
Rob K (1 month ago)
you have to forget everything from this video because its horrible, horrible and very horrible
Beard & Bald Head (1 month ago)
Why you type in notepad instead of your speech?
Aasd Enclosure (1 month ago)
weldone keep it up its really helpful to me Thanks
isunktheship (1 month ago)
Hold on a second.. you weren't passing the values in properly the first two times, so your query would have resulted on 0 rows.. but then since your username and password were also blank (""), I guess it passed? So you effectively hacked your own site.. if you logged in with ["",""] I bet it would work too.
Ross O'Neill (1 month ago)
Thanks for this video. Was exactly what I needed.
Ptimou (1 month ago)
Since when text tutorials get so popular ??
Marsu (1 month ago)
DO NOT FOLLOW THIS TUTORIAL FOR A REAL-WORLD PROJECT If you want to see what a developers workflow is like, this video does a great job of demonstrating. But the actual code is very likely to break and it uses really outdated procedures, even for 2015. Please find yourself another tutorial made in the last 6 months or so. Preferably one that teaches you about password hashing, prepared statements, and writing functions to reduce messy duplicate code. Or better yet, find a framework you can use that takes care of database stuff for you. There's no sense in re-inventing the same thing all the time when there's hundreds of options out there to make your job easier, your code more secure, and your time better spent. For free.
ian fer (1 month ago)
@Kevin Tran you mean ur not even using password hashing.
exoshyfer (1 month ago)
@Marsu oof
Marsu (1 month ago)
@Kevin Tran Your age might be starting to show somewhat then
Kevin Tran (1 month ago)
bro I've been an engineer for 19 years and this is the best method of doing it
Belabbas Mohamed wael (1 month ago)
Thank you sir
Jennifer Davis (1 month ago)
God bless fabuloushackers.wordpress,com for saving my life, i just received 4,000 USD.
Misex Xshop (1 month ago)
se demora la explicación pero funciona
Cumzzz (1 month ago)
here I pissed in my pants with laughter 16:30 haha and again here 17:14
https://prospero.ru/flyer.580931.html

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.