44: (UPDATED VIDEO IN DESC) How To Create A Login System In PHP For Beginners | PHP Tutorial

  Рет қаралды 1,121,440

Dani Krossing

Dani Krossing

Күн бұрын

Пікірлер: 2 800
@Dani_Krossing
@Dani_Krossing 5 жыл бұрын
I daily receive the same question from different people about having to pay $5 for the CSS file, so before asking here is my answer :) Yes you do need to be a Patreon supporter to download my lesson files INCLUDING the CSS file, and here are a few reasons why. 1: CSS should be easy for you to do at this point, therefore you should not need my CSS file. 2: This is not a CSS tutorial, and my subscribers even voted on me not including CSS in my videos because it took too long. 3: You are not supposed to "just copy" from this video, you are supposed to "learn and apply" to your own website. Therefore again, you shouldn't need my CSS. 4: People have already supported me on Patreon to get the CSS file, therefore I won't suddenly make it free to download. 5: Majority of my subscribers where the ones who pushed the idea of me using Patreon for my lesson files, and I have their full support in doing so. I keep getting comments where people either want to argue with me on why they should be getting my lesson material for free. I don't know if it is a lack of understanding that KZbinrs also need to pay their bills, or if they simply don't care as long as they get the material for free. But this is how I run my channel :)
@jimgerth6854
@jimgerth6854 5 жыл бұрын
Totally agree and keep up the good stuff! Btw can you tell me what video you’re referring to at 4:36, the „PHP course before“?
@Dani_Krossing
@Dani_Krossing 5 жыл бұрын
Hi Jim, here is the link for that video I mentioned :) kzbin.info/www/bejne/nH63p5xph96mY9E
@InfiniteThrees
@InfiniteThrees 5 жыл бұрын
​@@Dani_Krossing it's great to see that you're active in the comments :). Do you address the duplicate email problem in your forgot password script video?
@glennv.merkel3020
@glennv.merkel3020 5 жыл бұрын
agree, programming is practicing also it is ur effort bro...however ur are the best i like ur videos :P
@NewtonCazzaro
@NewtonCazzaro 5 жыл бұрын
You are absolutely correct, don't even bother adding a CSS file this! You are amazing, thank you so much for this video. I really appreciate it and it really changed my life! Ps. To the people asking for the CSS stylesheet, give us a break... you are watching an advanced computer science video and asking this wizard for a CSS stylesheet? You guys should feel embarrassed of such a stupid complain.
@demliquids9381
@demliquids9381 5 жыл бұрын
shocked at how anyone can give out such a high quality work for free. this was wonderful
@Dani_Krossing
@Dani_Krossing 5 жыл бұрын
Thanks :)
@bitmammothOG
@bitmammothOG 4 жыл бұрын
Patreon helps him a ton :) I support there, its definitely worth considering the contribution.
@techcanyon411
@techcanyon411 4 жыл бұрын
@@bitmammothOG There was a time i signed up for Patreon for one month but i did not got what i am looking for;a complete login system.Patreon had many branches of payment rate and it pissed me off.
@bitmammothOG
@bitmammothOG 4 жыл бұрын
@@techcanyon411 thing is you are looking for a complete system not learning how to do it yourself. I think you might be better off searching something like Udemy for that sort of info. I do however advise against that out of my personal experience it leads to really old outdated systems. If you stop and think about what you see from each video you already learned way more than you can anywhere else for 5$ a month.
@bitmammothOG
@bitmammothOG 4 жыл бұрын
I once asked how I could do something Daniel already had explained and he clarified which videos to watch then I realized I actually already knew how to do what I was asking. I never had this problem again after that. You want full login system, I believe that is also posted in the current updates on the Patreon but you can always recreate it from the videos on youtube for free. Also for the record, I am not Danial I am Terry an actual supporter :)
@fluffyfetlocks
@fluffyfetlocks 6 жыл бұрын
Finally, someone posted a well crafted login system guide that actually explains something. Allot of guides out there say "copy paste this" and then it is difficult to to troubleshoot. They often dont work too as they are for php5
@whiteavem5438
@whiteavem5438 5 жыл бұрын
yes!!! exactly
@alexandertrists3965
@alexandertrists3965 5 жыл бұрын
this IS difficult to troubleshoot! please see my comment to mmtuts $5 post.
@7Mirino
@7Mirino 5 жыл бұрын
Not only is his tutorial extremely informative and well laid-out, it's also ENTERTAINING to watch. I find it very difficult to sit for almost 2 hours straight just watching a video, but the way this is presented made those hours fly!
@GeorgeBrotherston
@GeorgeBrotherston 4 жыл бұрын
I am relatively new to PHP, and found your courses via a KZbin search. These courses are the best I've seen and I wish to thank you for creating these! I just signed up for the $5/mo. Patreon, and expect to continue support for as long as I am learning through your system. I am interested in many of the topic areas you have available, with each having multiple videos broken down nicely by subtopic. I wish you success in your continued endeavors and look forward to exploring your content!
@imanechakri4290
@imanechakri4290 4 жыл бұрын
can you send me the css code . i'm a student i don't have money for patreon :/
@benjaminibok8003
@benjaminibok8003 3 жыл бұрын
I just finished seeing the second php login system video, and I wrote out everything, I hope I can follow my scribbles without needing the video. Great work right here Danny, thanks so much...
@Brrrndy
@Brrrndy 5 жыл бұрын
LMAOOOOOO! I TOOK 7 HOURS TO WRITE THE CODE AND FIGURE OUT WHY MY CODES WONT WORK. But thanks for this tutorial. Keep up the good work!
@Scobb447
@Scobb447 5 жыл бұрын
Hey, just wanted to point out a little error... At 1:47:44 You should have the following: else if (isset($_GET["signup"])) { echo "Success";} or else you'll get a error for signup being empty.... AWESOME GUIDE BTW
@Jamie-pb5tq
@Jamie-pb5tq 5 жыл бұрын
changed that and still getting empty fields error
@uvebgns8224
@uvebgns8224 5 жыл бұрын
thank you !!
@sed10001
@sed10001 4 жыл бұрын
Thanks a lot!
@newyorkonmusic8401
@newyorkonmusic8401 4 жыл бұрын
You can do this very easy and user friendly instead. Add this just below the code: else if ($_GET['signup'] == "new"){ echo 'Just fill in the fields.'; } And in your header.php change the signup a href link to Signup
@NoName-rs4th
@NoName-rs4th 4 жыл бұрын
thank you man
@noumansyed5968
@noumansyed5968 4 жыл бұрын
(00:00:00) Introduction (00:01:08) Technical info you need to know (00:03:45) What you need to have ready before we start (00:05:28) HTML & CSS markup (00:23:49) Setting up our database (00:29:59) Creating the PHP signup script (01:15:51) Creating the PHP login script (01:35:39) How to start a session on all website pages (01:36:37) How to change website content when logged in (01:41:10) Creating the PHP logout script (01:42:56) How to create error messages (01:48:42) If you got an error during this tutorial THIS IS AMAIZINGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
@erissanorma5891
@erissanorma5891 4 жыл бұрын
thanks for the link!
@g-shubham
@g-shubham 4 жыл бұрын
Thanks !!
@evan.5967
@evan.5967 4 жыл бұрын
it's in the desc lmfao
@iconsworld9
@iconsworld9 2 жыл бұрын
nice paying maxiumum attention.
@saranghaeyo.carvz.
@saranghaeyo.carvz. 2 жыл бұрын
Hi.. I'm a CS Student & I really learn a lot in your video tutorials.. It really help me in building our system for our school requirements.. We are so lucky to have someone like you who have all the passion in creating all this video lessons.. Its a very big help especially for us students.. Thank you so much for creating this superb channel.. Looking forward to more video tutorials of yours!
@victoriagn5934
@victoriagn5934 4 жыл бұрын
mmtuts!!! honestly, you saved me from failing one of my programming classes, I was turning in empty docs because I honestly did not know how to do anything (its an online class and my professor only uploaded his lesson plan at the beginning of the semester lmao) thank you sosoosososo much, your lessons are the best!! REALLY THANK YOU. I'm becoming a patreon supporter now for sure:))
@oscarmartinlive
@oscarmartinlive 4 жыл бұрын
This is by far the best PHP login system tutorial I've seen on KZbin. Thank you.
@ricardocosta5628
@ricardocosta5628 4 жыл бұрын
I know I'm not early, but you might just have saved my graduation's final project bro. That's a sub for sure.
@ruthogadina757
@ruthogadina757 3 жыл бұрын
same 😂
@thatminivan
@thatminivan 5 жыл бұрын
Your work and passion reflects on your videos and files carefully documented. I am now subscribed to your patreon, I feel like you putting the best in your work. It's amazing how good you explain every step. Exactly what I needed. I've been hunting for codes on github and random sites but this is so much more worth it than spending hours trying to understand on your own.
@afuwapedoyinsola844
@afuwapedoyinsola844 2 жыл бұрын
2022 AND THIS IS STILL THE GREATEST TUTOR / TUTORIAL OUT THERE FACED A NUMBER OF ERRORS MY SELF AND TOOK TIME TO FIX IT P.s for who it may concern make sure to create and else statement for an empty fieldset during user login LOVE From NIGERIA 🇳🇬❤
@Osuna2024
@Osuna2024 5 жыл бұрын
You are really good, man. Thank you very much. I took a full web development course in college and didn't learn half as much as I did with you in this video. Sure, anyone can make a simple video for logins but with ZERO cybersecurity or database creation. Again, thank you so much.
@SCHNEE666
@SCHNEE666 5 жыл бұрын
Wow, I actually learned more from this tutorial than in the past semester at my university :D Thank you!
@besz2189
@besz2189 4 жыл бұрын
haha same here :D
@mounir101
@mounir101 6 жыл бұрын
Your voice is great and very clear.
@0596sami
@0596sami 5 жыл бұрын
As always
@amasnur79
@amasnur79 4 жыл бұрын
Thank you for this terrific tutorial. Yours has the best coding practice compared to other tutorial videos I have viewed. However, there is a flaw that I detected: 1:47:25 You did not check if signup is set. As a result, if you access the signup page from index.php (when there are no other error tags in the url), you will get error "Undefined index: signup". My workaround is to do if (isset($_GET['signup'])) first, then check if it is equal to "success".
@tp5723
@tp5723 4 жыл бұрын
This is the only little error i recognized, too. I solved it by adding: else if (empty($_GET)) { # code... } just before else if ($_GET['signup'] == "success") { echo ' Signup successfull'; }
@learningenglishisfun1470
@learningenglishisfun1470 4 жыл бұрын
That's correct! thanks
@khuramshahzad9089
@khuramshahzad9089 2 жыл бұрын
At 40.22 to check if the input field is emp1ty u can go in html code and inp1ut tag and write required before closing that tag. It is that simple we dont need that php condition . The video is one of the best on this lesson.♥️
@Dani_Krossing
@Dani_Krossing 2 жыл бұрын
If you watch the updated video, I explain why you shouldn’t do that. 🙂 HTML is not safe to use. You can VERY easily just remove the “required” attribute using the browsers build in dev tool. The same goes for any other front end (JavaScript for example), never use it for security. ALWAYS use backend like PHP for security. So no it isn’t as simple as that. 🙂
@khuramshahzad9089
@khuramshahzad9089 2 жыл бұрын
@@Dani_Krossing 😱 U r right Thanks. ♥️
@jonathanX01
@jonathanX01 4 жыл бұрын
At 1:39:39, when you mention that a lot of people asked how do you change content whenever you are logged in or not, I think they mean like profile pictures, bio, and user pages. At 1:40:55 or so, you were doing it the longer way but you can split the php code and block the entire html code so you don't have to put it in an echo, which works because I have done it many, many times.
@sipofbruno6611
@sipofbruno6611 4 жыл бұрын
For those worrying about the CSS stylesheet, I had no idea how to use CSS so I paused the video, and watched “CSS Crash Course for Absolute Beginners” and a day later I managed to create the same exact design used in this video. Wasn’t that hard.
@imanechakri4290
@imanechakri4290 4 жыл бұрын
can you send me the css code . i'm a student i don't have money for patreon :/
@camilabooth7397
@camilabooth7397 4 жыл бұрын
18:09 stopped the video to css the crap out of my php page! Thanks for the lesson!
@farhadboy629
@farhadboy629 4 жыл бұрын
This guy will make me an entrepreneur
@lepystudio8974
@lepystudio8974 4 жыл бұрын
Coder maybe
@jorgetonos
@jorgetonos 4 жыл бұрын
Bro, I don't think there is an actual word to show my gratitud to you, all current word on the dictionary don't define why I feel right now, so I just will say THANK YOU in caps. I mean, this is, FOR SURE, the best php login tutorial for beginners EVER. Man, you don't just explain with details what is what you're doing, why you're doing it and what the code is for but as well you make sure you're following the latest security measurements out there. I mean, this is just too much, again THANK YOU for your effort in making these videos, the community appreciates it. You have a spot in heaven already my fellow.
@mohibqureshi391
@mohibqureshi391 4 жыл бұрын
man....I just can't stop watching you...i mean... your teaching style is unique ...i like it...
@maddragonfurs6358
@maddragonfurs6358 3 жыл бұрын
You just saved me from certain doom, i thank you and will name my first born in your honour
@absterexe
@absterexe 5 жыл бұрын
Thanks mmtuts ! GET THIS GUY A MILLION OF SUBS.
@JimfromIndy
@JimfromIndy 6 жыл бұрын
I need to point out that you have allowed multiple users to use the same email address. When you fetch the user upon signin, you assume there is only one. You could easily end up with users having multiple usernames with the same email address, and not knowing which user you selected.
@Dani_Krossing
@Dani_Krossing 6 жыл бұрын
You are right that is something to look out for. I didn't want to go over a whole lot of error handlers in this episode otherwise the already long video would get even longer, however you are right that this is a factor when we allow users to log in using an email as well. The login system doesn't "break" per se, however when the user logs in they will only log in as the first user in the database with that e-mail. The other users with the same e-mail are just going to get ignored. I'm gonna go ahead and include this in the description of the video and I will pin your comment as well :)
@brantedselnemiada4956
@brantedselnemiada4956 6 жыл бұрын
I also wonder that would happen, thanks for commenting it out. Btw, I'm done fixing it for those who wants the code: //Check if the email already exist $sql = "SELECT * FROM users WHERE user_email='$email'"; $result = mysqli_query($conn, $sql); $resultCheck = mysqli_num_rows($result); if ($resultCheck > 0) { header("Location: ../signup.php?signup=emailexist"); exit();
@syahmiahmad2166
@syahmiahmad2166 5 жыл бұрын
i was about to point that out . you beat me to it .
@angelshallom6781
@angelshallom6781 5 жыл бұрын
@@brantedselnemiada4956 where should this code be placed?
@brantedselnemiada4956
@brantedselnemiada4956 5 жыл бұрын
@@angelshallom6781 at your signup.inc.php file add that code to your error handlers, dont forget to put it inside of an else statement like this: else { //Check if the email already exist $sql = "SELECT * FROM users WHERE user_email='$email'"; $result = mysqli_query($connection, $sql); $resultCheck = mysqli_num_rows($result); if ($resultCheck > 0) { header("Location: ../signup.php?signup=emailexist&first=$first&last=$last&uid=$uid"); exit(); }
@haakonenoksen9383
@haakonenoksen9383 2 жыл бұрын
Extremely good lessons. I suggest to do all the error checking at once and send the whole result back for the user to correct. The way it is now set up, the user has to correct one mistake at a time. Let's say he made an error in all entries. He is sent back and forth 6-7 times and finally get the message that the user is already registered. He forgot that he registered 2 years ago. Also I think there is no point sending back the pwd when they don't match. You don't know if the error is in the first or the repeat password. Or, send them both back and the user can have a button to press to show the passwords.
@christopher7540
@christopher7540 4 жыл бұрын
thank you man i'm a complete beginner to php but you made the whole process very easy to follow and understand very useful and still relevant in 2020. thank you
@didierdelay6623
@didierdelay6623 5 жыл бұрын
Hi, Your video is really impressive. You manage to clearly explain a quite sensitive subject. That'a great. There is one thing that could actually be confusing for some people. Right at the beginning of the video (around 02:20), You specify using mysqli which is not mysql, and mysqli is the new improved version replacing the older mysql obsolete for quite a while now. This is totally true and very important to mention such thing as thy re still out there many documentations based on mysql. However, the way you say it could be confusing for some people. It could actually be understood as MySQL (the database server) is obsolete, when the mysql library (or extension) is the outdated stuff. Never the less, I think you have done a great job at publishing this video, clear, instructive, inspirering. Quite long, but justified, and that's definitely not a problem when user can pause as often as needed. Thank you very much
@cobrassasino
@cobrassasino 5 жыл бұрын
good explanation. I just wandering why he uses mysqli instead PDO. I know PDO is very common, I though is behind Laravel, Wordpress etc...
@cobrassasino
@cobrassasino 5 жыл бұрын
I anwser myself. I found this on : "websitebeaver.com/php-pdo-vs-mysqli". "My opinion is that PDO should be used by default, especially beginners, due to its versatility, general predictability and useful fetch modes. However, MySQLi would be a better choice for advanced users who want the newest"
@hasanajami7653
@hasanajami7653 6 жыл бұрын
1h, 49min, 36s It's a Challenge... [ACCEPTED] Btw. you're the best:)
@gosavva1
@gosavva1 6 жыл бұрын
Wow, a new login system video that is why I love you and love your videos, you always update your videos .. now I will start watching, thank you from now because I know it will be very helpful.
@NoxaDreshar
@NoxaDreshar 4 жыл бұрын
Hey mmtuts, fellow coder veteran here. I just stepped over your video and was quite surprised by the quality and detail of this tutorial. You put in a lot of work, information and also error handling for the user which is quite not usual these days, especially for free. My kudos to you. Keep up the good work.
@alexalmu9191
@alexalmu9191 4 жыл бұрын
In case you get success, but no data in your database, please make sure you are using php 7.0. I used nucserv for localhost and did not work, then I installed xampp and it was working(local) and finally, I have upgraded the php version from my panel and I have got data in my database. (also online).Thnak you for the video! Great work!
@poorboy2400
@poorboy2400 5 жыл бұрын
this tutorial was extremely helpful, thank you for your efforts good man and i hope you upload the tutorial on the user page soon!!!!
@hersonbalisi4075
@hersonbalisi4075 4 жыл бұрын
hey! Im kinda new to programming here, very thankful I've found your tutorials! I admire your patience and energy putting everything in words just to explain php to somebody like me, lol.. keep it up!! I will be waiting for your new tuts! btw, got a questuin though, I've watched this video twice, and I dont think you kinda run an error check if the same EMAIL already exists in the database, or i just missed it? PS: i dont really get the concept of that "prepared statement" thing haha! thanks!
@tailboat
@tailboat 4 жыл бұрын
This is true he doesn't, but it can be easily done by adding the OR operator in the SQL query created at 53:26 He shows how to add the AND operator while creating this (55:16), just switch that out for the OR and check the email. You would have something that looks similar to this: "SELECT uid FROM users WHERE uid=? OR email=?"
@angelrico640
@angelrico640 6 жыл бұрын
Thank you for all the help. You have teach me more than college's teacher. xD Kidding, but definitely a big help in my projects.
@LayKxD
@LayKxD 4 жыл бұрын
I wish I could like this video 5,000 times I have to learn PHP and SQL basically in half a semester, and this dude is the real deal.
@sumdev4983
@sumdev4983 Жыл бұрын
How can anyone complain about paying 5 bucks for access to the files? Your content is amazing and because of content providers like you, I have a new career that pays well and I'm about to start my own business. I can't thank you enough for all your hard work.
@Wakssbm
@Wakssbm 5 жыл бұрын
I can't thank you enough for this tutorial! Well made, well explained, I had no question!
@bankoleemmanuel1088
@bankoleemmanuel1088 6 жыл бұрын
Wow... My mentor. You re-upload this again!!! 🙌🙌🙌😉
@revanslacey
@revanslacey 4 жыл бұрын
27:58 Just looked up SQL text types. TINYTEXT has a maximum of 255 characters. LONGTEXT has a maximum of 4,294,967,295 characters. Should be enough for a reasonably secure password!
@loosabway3400
@loosabway3400 4 жыл бұрын
Amusing...
@akachi1637
@akachi1637 4 жыл бұрын
That is 4gb of password!!!!!
@haziqsontkraken1246
@haziqsontkraken1246 4 жыл бұрын
how long password did you use? sure, hashing uses a lot of space, but 4GB is kinda overkill
@gonefishing2006
@gonefishing2006 Жыл бұрын
Well I'm back watching this one (again). Moved my pages to a new machine and for some reason some of them don't work like they did and I don't like what they look like so refresher course time. Wish you still did PHP videos like you did back in the day.
@joelnjoroge7202
@joelnjoroge7202 3 жыл бұрын
Finally after many trials I have done it! Thank you very much Krossing for this. ...I kept getting this sql error only to realize I had put the query before the connection. so the query wasn't getting executed as there was no connection to the database. Guys make sure you order things correctly on line 17 of login.inc.php (referring to Krossing's file).
@tommmmmer
@tommmmmer 4 жыл бұрын
FIX: Like many many comments here there is an issue when you signup. signup.inc.php signup.php?error=sqlerror This means the validation checked out but as soon as SQL comes into play it fails. I've tested the DB connection, tested that I can insert from PHP, tested that I can insert on the database. Check these lines are just like this: $stmt = mysqli_stmt_init($conn); if (!mysqli_stmt_prepare($stmt, $sql)) I think in the video he modifies this at one point nad for me I had one entry of ""mysqli_stmt_init" and the other "mysqli_init
@alexzil2142
@alexzil2142 4 жыл бұрын
I'm not understanding this I'm having an "object not found error 404" and at the same time I'm seeing the "sign up.php? error=sqlerror" on my header I'm very confused and frustrated
@tr0uge962
@tr0uge962 5 жыл бұрын
mmtuts = "The styling doesn't have any impact on how to login system works" me = " nav{display:none;} "
@revwhyte
@revwhyte 5 жыл бұрын
You're not wrong XD
@karmanetworkit6787
@karmanetworkit6787 4 жыл бұрын
ahahaahahhahah
@teacuptea9155
@teacuptea9155 4 жыл бұрын
Why did I find this funny lol
@Haider-ol7jr
@Haider-ol7jr 4 жыл бұрын
Tr0uge what a 5 head move haahaha
@someoneontheinternetuvenev6268
@someoneontheinternetuvenev6268 4 жыл бұрын
Lol dude
@paulgarcia2887
@paulgarcia2887 5 жыл бұрын
Are you going to create a video on a user profile? I'm trying to figure out how to make it so that when a user logs in information about their account balance shows up.
@cristidumitrescu557
@cristidumitrescu557 4 жыл бұрын
BIG LIKE. if someone gets stuck at the if statements in index.php, be patient until you create the logout file, because that helps unset the variables in the session and allows the if statements to work correctly.
@a.yashwanth
@a.yashwanth 4 жыл бұрын
Use header>nav>(a>img)+ul>(li>a)*4 for 9:05 if you have emmet.
@tysonhamada6527
@tysonhamada6527 5 жыл бұрын
Thanks man awesome tutorial nice teaching style better than my uni teachers
@Dani_Krossing
@Dani_Krossing 6 жыл бұрын
Hi everyone! Yes this is a re-upload of an older tutorial :) The older version of this video had quite a lot of things I wanted to change both in terms of PHP structure and security. Therefore I have made this new updated version which is a bit longer, but I promise it is worth the watch. ENJOY! :)
@der4233228
@der4233228 6 жыл бұрын
Thank you very much. Well done.
@alphagaming1995
@alphagaming1995 6 жыл бұрын
Please make a video on Forget password in php
@yasmeentahir5842
@yasmeentahir5842 6 жыл бұрын
Thankyou Very much
@BarnabyPerrinAldous
@BarnabyPerrinAldous 6 жыл бұрын
This upload is a major coincidence for me. I followed the old video and then I decided to view the series from scratch. Today I got to episode on hashing and dehashing data and today you upload this. Very handy for me, thanks Daniel!
@DR9Productions
@DR9Productions 6 жыл бұрын
Hi mmtuts. First of all, I just wanted to let you know that I have learned a lot by watching your video tutorials! The way you explain things are really easy to understand!! I am also, trully very thankful to you for the amount of time you spend making this fantastic videos and sharing with so many of us your knowledge. I have watched a lot of tutorials about making login systems, but the thing that is more difficult to find and is probably one of the biggest concerns for the must of us is the security of the system. There are so many threats online, like sql injections, hacking sessions and so many more that the must of us are not even aware off. So, what I am trying to say is... how can the must of us protect our login and management systems from all this threats? If you were to make a high security system for a login and admin system, how would you do it? Would you create a php file like security.php with all the security classes and functions inside it and called them when needed?! Would that be a easy way to update future security features?! Would you create and generate automatic tokens to prevent sessions hacking? Once again, thank you very much for sharing your knowledge with us!
@austingriner2773
@austingriner2773 5 жыл бұрын
Add this to to automatically fill it in after returning from the error page, if it had been filled in already: value="" You can do the same with your other text fields as well, only needing to change the "name" part.
@HarshdeepSingh-iz6gr
@HarshdeepSingh-iz6gr 5 жыл бұрын
Just what i was about to write... Good to see someone else is paying attention!!! He didn't actually cover this part!!!😄😄😅
@timanderson5717
@timanderson5717 4 жыл бұрын
Why not use That way you're not repeating the name. Also it's shorter. Although, either way you might open yourself up to XSS attacks if someone goes to page.php?name=%3Cscript%20src="evil.com/bad.js/"%3E
@Jansa372
@Jansa372 4 жыл бұрын
I'm sorry but I didn't quite get it. So do i have to write that in the html input?
@BanDrag0n
@BanDrag0n 4 жыл бұрын
how can I do the same thing for the login box? I want it to refill the username if the password was wrong
@majidnafarabad7311
@majidnafarabad7311 4 жыл бұрын
I returned back to web design after 5 years and this video really helped me recall many items. Thank you so much, it was very clear and helpful.
@anonntsc5222
@anonntsc5222 3 жыл бұрын
Your explanation is much better than my lesson at school . Although I don't really understand all, because language problem. Thank you!
@georgelopez9356
@georgelopez9356 4 жыл бұрын
Hi mmtuts, I believe you're totally right about charging for your files, what is $5, $20 or even $50 for such a good work!. People prefers to spend $500 at Disneyland rather than pay for something that will help them prosper. If I where you I'd not listen to this people and use my focus and energy to develop more quality curses like this one! Thank you!
@fling2985
@fling2985 5 жыл бұрын
When I click the signup button after I wrote in all the correct information it takes me to signup.php?error=sqlerror instead of showing success. I've checked through the code for errors or wrong spellings and I've gone through everything in your code multiple times. I cant find a way to fix this...
@justdaidalos985
@justdaidalos985 5 жыл бұрын
Same. Anyone solved that?
@lightyagami3650
@lightyagami3650 4 жыл бұрын
No. I'm also trying to figure out what's wrong. I did everthing exactly like him
@lightyagami3650
@lightyagami3650 4 жыл бұрын
Just solved it. I made the mistake to write "!mysqli_stmt_prepare($conn, $sql)" and "mysqli_bind_param(...)". But insted I should have written "!mysqli_stmt_prepare($stmt, $sql)" and "mysqli_stmt_bind_param(...)". Hope that will help you!
@per1sher
@per1sher 4 жыл бұрын
This is excellent - thank you for posting. I'll remember you when I float my facebook killer website...
@androidmod183
@androidmod183 2 жыл бұрын
Just watched all previous lessons and i figured out that there's an updated version for this current video, well i guess i will pass on this one and go to the new one :) Thank you for your content
@NanoStudio9
@NanoStudio9 4 жыл бұрын
It amazes me that you've provided such high quality work for FREE. This was my first attempt at learning PHP and succeeded. Thank you everything you've done!
@Orincaby
@Orincaby 5 жыл бұрын
The "i" in MySQLi means "i'm the newer version so you have to use me"
@privateger
@privateger 4 жыл бұрын
Don't use it. Use PDO.
@OmnivorousOtter101
@OmnivorousOtter101 4 жыл бұрын
dontquestionmyactions, why?
@privateger
@privateger 4 жыл бұрын
@@OmnivorousOtter101 Because mysqli has been replaced by it. PDO is way easier to use, universal across many database systems and more secure. The MySQLi functions currently only exist for compatibility reasons.
@williamalesna5703
@williamalesna5703 4 жыл бұрын
lol xD
@LuBre
@LuBre 4 жыл бұрын
Nope, you should use PDO instead.
@jakobkmar
@jakobkmar 5 жыл бұрын
Such a great tutorial! So detailed and mentiones everything you need to know.
@sebastian993
@sebastian993 5 жыл бұрын
where was this 15 years ago when we had to do it as part of an assignment lol..
@arzfiring3331
@arzfiring3331 4 жыл бұрын
Thank god it's atleast available now, so that I can do my assignments 🙃🙃
@parthip998
@parthip998 3 жыл бұрын
@@arzfiring3331 Same 😁
@Maths4Everyone
@Maths4Everyone 4 жыл бұрын
This is so clearly explained. I was dreading creating a login system, but after just a few hours I had one... a couple of hours later I had one which was fully customised for me. Thank you.
@googleaccount-n3d
@googleaccount-n3d Жыл бұрын
just a suggestion , in order for us to know when this video is taken its best to show the time stamp on windows in bottom right corner ;) helps a lot to know when its done and to see if there are any updates from the program that you are teachen. thanks ! big fan !
@nhoviepante7644
@nhoviepante7644 4 жыл бұрын
Its not working with me it is showing the sqlerror.
@karlkarlson1606
@karlkarlson1606 4 жыл бұрын
I am having the same issue and have rewritten it, did you ever figure out why?
@karlkarlson1606
@karlkarlson1606 4 жыл бұрын
I just figured mine out it was a typo in my name of uidUsers
@mrdark3903
@mrdark3903 5 жыл бұрын
no matter what i do i always get this massage: Fill in all fields!. in the signup page. I have done exactly same as you, and i dont know where the problem lies
@randomTVSWE
@randomTVSWE 4 жыл бұрын
did you solve it?
@flaasher
@flaasher 6 жыл бұрын
Plz make a tutorial with example on how to build a project with MVC and dealing with DB
@nmrisrl11
@nmrisrl11 6 жыл бұрын
Ali Saleh Good suggestion.
@calebngugi
@calebngugi 2 жыл бұрын
Superb video 👌, although I'd like to mention that naming a php with a .inc is a serious vulnerability. If the webserver is not told to run a .inc page as a php file i.e. for e.g. if someone deletes the .php at the end of the filename on the URL, then it'll run as text. And if you have sensitive info like name and password of your database... Thanks for the video, I've learned awesome new stuff 😀
@davidsmith-ws4bz
@davidsmith-ws4bz 4 жыл бұрын
Very helpful video. Anyone new to MySQL finding themselves locked out, might try right click on the XAMPP icon, and click on (run as administrator). This helped heaps when i was learning, and kept getting locked out.
@arthemyvandalovski1504
@arthemyvandalovski1504 4 жыл бұрын
I get the error message empty fields even thought i filled all the fields
@N-.-A
@N-.-A 4 жыл бұрын
Arthemy I had the same but figured it out. It's because isset will only return 0/1 true/false. You dont want that, you want the string of the variable 'error'. So instead of isset($_GET['error']) just do: $_GET['error'] Now you got the string to check with and not a bool.
@vahidor1540
@vahidor1540 4 жыл бұрын
hi i see this error when login: Fatal error: Uncaught Error: Call to undefined function mysqli_stmt_get_result()
@crumbae1248
@crumbae1248 4 жыл бұрын
You Should Keep $stmt Inside TheBrackets Of mysqli_stmt_get_result()
@logireloco123
@logireloco123 4 жыл бұрын
or $stmt->get_result();
@jayjassi5008
@jayjassi5008 4 жыл бұрын
where the password is verified in the login script, when run on the page, it outputs wrong password in the url despite it being correct (not logging in)
@migjeniljazi5416
@migjeniljazi5416 4 жыл бұрын
yeah im having the same problem as well
@aliadilovic2294
@aliadilovic2294 4 жыл бұрын
try make if(row['pwdUsers']==$password){ ...}, instead of password_verify part, it worked for me
@Kenny-ft9gd
@Kenny-ft9gd 4 жыл бұрын
@@aliadilovic2294 $pwdCheck = ($row['pwdUser'] == $password); like this?
@sexychick9850
@sexychick9850 4 жыл бұрын
Did you ever fix it?
@jacobmackay3543
@jacobmackay3543 4 жыл бұрын
I had set the user passwords max value to 50, in the database, but because of the hashing, it makes it longer than 50 so would throw this error. I changed the value length in the phpmyadmin and it worked
@diahooh
@diahooh 4 жыл бұрын
2 years late but thank you so much Dani, this was the best tutorial I've seen.
@DCG_42
@DCG_42 3 жыл бұрын
I need to learn php really fast so this was a good dive into php, this was basically a simple fullstack thank you. This language is very powerful and contains so many useful things for web dev.
@samueliaconelli6943
@samueliaconelli6943 4 жыл бұрын
damn, i forgot the i of mysqli. Dont repeat my same error:(
@partians
@partians 5 жыл бұрын
when I try to login it says success however it still shows You are logged out, the same code that you showed is used.
@wyanido
@wyanido 5 жыл бұрын
I'm having the same issue
@wyanido
@wyanido 5 жыл бұрын
Hi again, I found a solution to this problem. It worked for me and I hope it will for you as well. In each of your pages at the top where it says require header.php, make sure that the block of php is right at the top of your code with no blank spaces before it. Place it even above
@partians
@partians 5 жыл бұрын
@@wyanido Hey, glad you have that issue fixed. My fix was the userid names for the session.
@Some_Techie
@Some_Techie 5 жыл бұрын
@@partians hello parTians, could you please go into detail on how you found that fix? I'm a newbie and I'm having this problem. Thanks.
@Karaamjeet
@Karaamjeet 5 жыл бұрын
@@Some_Techie same with me
@photon2724
@photon2724 5 жыл бұрын
its a great experience getting taught by a young elon musk
@reistophmilkayr3215
@reistophmilkayr3215 5 жыл бұрын
Yeah, dats why I kinda remember the face
@markedwards3780
@markedwards3780 3 жыл бұрын
Dani, I think that your lessons are superb and I really don't mind if I have to pay a small fee for dowloading any material you make available. I am learning so much from your lessons, and you have a natural ability to explain complicated concepts in a way that beginners can easily understand. Keep up the good work.
@blakestevenson3198
@blakestevenson3198 4 жыл бұрын
First off, your videos are very helpful. I did run into one problem on this video with my php recognizing the hashed password in my database. In your video you wrote that $pwdCheck = password_verify($password),$row['password']); However, whenever i used the correct password it always showed as false, and showed the error (localhost/index.php?error=wrongpwd) After hours of looking for defects in my code (because I am a newbie) I figured out that I would have to hash the submitted password prior to searching the database. I made a very small adjustment and it worked. $pwdCheck = password_verify(password_hash($password),$row['password']); Thanks for all of your help.
@shawngrant9488
@shawngrant9488 2 ай бұрын
YES THIS! Thank you so muchhhh! 😭Also, slight modification: instead of '$pwdCheck = password_verify(password_hash($password),$row['password']);', use ' $pwdCheck = password_verify($password, password_hash($row['pwdUsers'], PASSWORD_DEFAULT)); ' why? First reason is that in order to match the password, we have to unhash the password in the pwdUsers column of the database, not the user's input from the password field on the login page. Second, is that password_hash requires two arguments, not one, so you first need to specify the db password you want to hash, and then you need to specify the second argument as PASSWORD_DEFAULT. I don't know why we use PASSWORD_DEFAULT as the second argument, but from reading around and watching other Krossing php tutorials, this is the typical way to hash passwords.
@shawngrant9488
@shawngrant9488 2 ай бұрын
now my only issue left to resolve is to figure out why it doesn't render the "You are logged in!" response specified in the header.php file, even after the ' $_SESSION['userId'] = $row['idUsers']; ' line in the login.inc.php file sets it to the user's column ID value.
@shawngrant9488
@shawngrant9488 2 ай бұрын
Nevermind, I just figured it out in less than two minutes haha. Apaprently, I had a typo in that line of code. ' $_SESSION['userId'] = $row['idUsers'] ' should have actually been ' $_SESSION['userId'] = $row['idusers'] ' with the 'u' in lowercase. Why? Because the corresponding column id in my users table is titled 'idusers' not 'idUsers'. Sheesh typos suck!
@shawngrant9488
@shawngrant9488 2 ай бұрын
Hollyyyyy F**k the whole thing actually works now! Much thanks so much @blakestevenson3198!!! And much thanks @Dani_Krossing!!!!
@michaltymburski8528
@michaltymburski8528 5 жыл бұрын
When you say word " SO!" very often it hears like your using it like If statement inside if inside if inside if :D which i guess helps to understand those if statements :)
@intechmarketing6384
@intechmarketing6384 4 жыл бұрын
For people having issues with the user errors at the end of the video. Use this code:
@sutaschramm3195
@sutaschramm3195 5 жыл бұрын
It feels good after all of that, when you save the page and it works with no errors. 😀
@frankkaundamukhuni
@frankkaundamukhuni 4 ай бұрын
You are right professor Dan you can't just be giving all that information free.
@marcinmaj3609
@marcinmaj3609 6 жыл бұрын
Great! Now please remember me, forgot password, csrf Security and protected 3 login attemps.
@renestve7017
@renestve7017 5 жыл бұрын
Use cookies and sessions for "Remember me" and "login attempts"
@HarshdeepSingh-iz6gr
@HarshdeepSingh-iz6gr 5 жыл бұрын
well it isn't as easy as u'r making it look... php with cookies need to be learned... u can't do it on ur own.. Daniel's got a video for it. go check it out... It shows u how to create a forgot password system From there u might get some idea to make "remember me" feature.
@ckjones1
@ckjones1 5 жыл бұрын
Fatal error: Uncaught Error: Call to undefined function mysqli_stmt_get_result() in C:\MAMP\htdocs\Proyecto\includes\login-inc.php:25 Stack trace: #0 {main} thrown in C:\MAMP\htdocs\Proyecto\includes\login-inc.php on line 25
@ArtGateVR
@ArtGateVR 5 жыл бұрын
Anyone figure this out? I'm getting the same error.
@MaximumTino
@MaximumTino 5 жыл бұрын
I'm having this issue too, please help
@MaximumTino
@MaximumTino 5 жыл бұрын
My exact error comes up as Fatal error: Uncaught Error: Call to undefined function msqli_fetch_assoc() in C:\xampp\htdocs oot\HighFrequency.online\includes\login.inc.php:28 Stack trace: #0 {main} thrown in C:\xampp\htdocs oot\HighFrequency.online\includes\login.inc.php on line 28
@likemenotlikeyou
@likemenotlikeyou 5 жыл бұрын
I'm getting the same error as well
@inventustries887
@inventustries887 5 жыл бұрын
@@MaximumTino you forgot the y in msqli_fetch_assoc() it needs to be mysqli_fetch_assoc()
@stevenvanhulle7242
@stevenvanhulle7242 4 жыл бұрын
3:15 "this going to be a long video." Me, noticing the nearly 2 hours playing time: "O.M.G!"
@tokka2364
@tokka2364 4 жыл бұрын
Thanks man, I'm a 15 year old programmer and this was really easy for me to understand. I had an assignment and this made my life so much easier thank you
@magisChannel
@magisChannel 4 жыл бұрын
I love how you try to cover as many security issues as possible, but i think its important that you should point out, that you didnt secure your databasehandler in any way. So this system isnt secure at all. Of course you would secure the file on an actual system differently, but i think its a nice to know for beginner.
@devlinpaddock4363
@devlinpaddock4363 4 жыл бұрын
Hey just wanted you to know ^
@Raveloy
@Raveloy 5 жыл бұрын
i have a little problem and i dont know if it is just me whenever i try to login it always gives me the error "wrongpwd" no matter if it is the correct password can somebody help me? thank you
@Allizzify
@Allizzify 5 жыл бұрын
i have the same problem... did you figure it out yet?
@Allizzify
@Allizzify 5 жыл бұрын
i'm thinking it has something to do with the hashing of the pw
@calvinloh_ls
@calvinloh_ls 5 жыл бұрын
I'm having the same problem too, anyone managed to solve it? EDIT: SOLVED! What I did previously was I inserted the user id and pwd straight into mySQL without creating any signup form as shown by mmtuts. Just follow what he do and signup an account, try again then you're done.
@ramseybeing
@ramseybeing 5 жыл бұрын
me too
@ramseybeing
@ramseybeing 5 жыл бұрын
It could be that i cannot access localhost/phpmyadmin i have to enter my ip 192.168.64.2/phpmyadmin in order to enter. Any one the same?
@delowarhossain4523
@delowarhossain4523 4 жыл бұрын
"error=sqlerror" how to fix?
@luphoria
@luphoria 4 жыл бұрын
It could be many things, for me I had accidentally named my variable the wrong thing once.
@karlkarlson1606
@karlkarlson1606 4 жыл бұрын
same issue for me did you figure it out?
@karlkarlson1606
@karlkarlson1606 4 жыл бұрын
I just figured mine out it was a typo in my name of uidUsers
@delowarhossain4523
@delowarhossain4523 4 жыл бұрын
@@karlkarlson1606 yes.. I figured it out.
@delowarhossain4523
@delowarhossain4523 4 жыл бұрын
Can you please help me about php rest api crud??
@bowiemtl
@bowiemtl 4 жыл бұрын
I'm so glad that I was right about using sessions for my own attempt at a login system. My entire system was insecure and I knew it was but atleast I got one part of it right. Thanks for this tutorial!
@yuriyarin4027
@yuriyarin4027 3 жыл бұрын
Fantastic tutorial. The best part is that you explain every part in detail which is essential for those of us who are learning. One issue, I'm kinda wondering about. Now there's a require feature in HTML fields, which means that fields can't be sent empty. So what that means is basically that means that the if statement checking if the fields are empty, is redundant, isn't it? I'm just starting out now. Was this not available back in the day?
@Dani_Krossing
@Dani_Krossing 3 жыл бұрын
No it’s the other way around. The “required” attribute is not useful since it can VERY easily be bypassed using the browsers build-in developer tool. Front-end should never be used for security. Always do it through a back-end language.
@dragoscrx404
@dragoscrx404 5 жыл бұрын
My feedback: You write too much code and you never stop to test each step that you do.
@devmashup3700
@devmashup3700 4 жыл бұрын
At 54:01, at his line 16 I have a 'unexpected semicolon' even thou he has one.
@unchartify
@unchartify 4 жыл бұрын
did you manage to fix this? having the same error
@samuellee83
@samuellee83 3 жыл бұрын
@@unchartify same : (
@gonefishing2006
@gonefishing2006 3 жыл бұрын
@@samuellee83 I didn't get in trouble until line 51 when I forgot to put one in.
@noobiebro7266
@noobiebro7266 5 жыл бұрын
lord please make me rich... I want to support his patreon :(
@techcanyon411
@techcanyon411 4 жыл бұрын
I think you might pray that lord should give you the ideas to be rich.
@charliesmith8309
@charliesmith8309 4 жыл бұрын
man thank you so much. I haven't touched any other coding language other than html, css or java and I was able to get a pretty basic understanding of php just from this video, and everything worked perfectly. this was a straight up lifesaver. keep it up !! :]
@bwf1046
@bwf1046 4 жыл бұрын
Clear, simple, concise... just an amazing tutorial. These are the highest quality programming videos on KZbin.
45: What are arrays used for in PHP - PHP tutorial
3:43
Dani Krossing
Рет қаралды 50 М.
Шок. Никокадо Авокадо похудел на 110 кг
00:44
How Strong is Tin Foil? 💪
00:26
Preston
Рет қаралды 76 МЛН
The Joker wanted to stand at the front, but unexpectedly was beaten up by Officer Rabbit
00:12
Signup and Login with PHP and MySQL
43:16
Dave Hollingworth
Рет қаралды 280 М.
VSCode - The Complete Setup for PHP Development
33:59
The Codeholic
Рет қаралды 97 М.
Complete Sign up, Login and Logout System using PHP and MySQL.
50:16
Шок. Никокадо Авокадо похудел на 110 кг
00:44