How To Create A OOP PHP Login System For Beginners | OOP PHP & PDO | OOP PHP Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 พ.ย. 2024

ความคิดเห็น • 595

  • @Dani_Krossing
    @Dani_Krossing  3 ปีที่แล้ว +144

    👉👉I MADE TYPOS IN THE VIDEO YOU NEED TO FIX!
    👉ERROR 1:
    In login.classes.php inside the getUser() method, I made two important typos that will make your code not work. (WHOPS! 😅 ty Sentinel Corps for letting me know)
    The first SQL execution should be:
    $stmt->execute(array($usn, $usn));
    The second SQL execution should be:
    $stmt->execute(array($usn, $usn, $pwdHashed[0]['user_pwd']));
    👉 ERROR 2:
    As someone pointed out in the comments, using rowCount() to check how many results we get when we query the database, isn't a method that work in all database types. Instead you should use count() after you returned the data. Make sure you do it ALL PLACES where you SELECT from the database. 🙂
    SO INSTEAD OF:
    if($stmt->rowCount() == 0) {
    $stmt = null;
    header("location: login.php?error=usernotfound");
    exit();
    }
    $profileData = $stmt->fetchAll(PDO::FETCH_ASSOC);
    return $profileData;
    IT SHOULD BE:
    $loginData = $stmt->fetchAll(PDO::FETCH_ASSOC);
    if(count($loginData ) == 0) {
    $stmt = null;
    header("location: login.php?error=usernotfound");
    exit();
    }
    return $profileData;
    👉 ERROR 3:
    If you get a "undefined variable $result", then it is because your editor doesn't like when a variable is declared without a value assigned to it.
    To fix it, change:
    $result;
    To:
    $result = false;
    👉 BEFORE YOU COMMENT ABOUT LESSON MATERIAL:
    And for people who "want my lesson files for free", here is my answer to that. 🙂
    My subscribers has voted on me not including CSS in my future videos because it took too long, and because you already should know HTML/CSS at this point. This is not a HTML/CSS tutorial, and even so you are not supposed to "just copy" from this video, you are supposed to "learn and apply" to your own website. People have already supported me on Patreon to get my lesson files, therefore I won't suddenly make it free to download.
    People who think I'm obligated to "give my material out for free", have gotten the wrong impression about what rights you have. The free educational videos I make are a product I put a lot of effort into, and I can distribute it however I want. Just be happy that ALL my videos are free, and not on Udemy for $15. 😉
    I have seen some angry comments say that I'm "putting up paywalls" for my content, which would imply that you couldn't follow my tutorial without paying for my files... So let me debunk that really quick...
    There is NO "extra" PHP in my lesson files, that you won't find in this video. The "lesson material" is meant for people who are making mistakes or typos in their code, and would like my personal files to compare to see where they made mistakes. Or for people who want MY HTML and CSS. 😊
    This is how I run my channel so deal with it. 🙂 I won't argue with anyone about it.

    • @mariamzayed91
      @mariamzayed91 3 ปีที่แล้ว +3

      thank you Dani for giving us these videos anyway, it's really helpful❤❤We appreciate your efforts❤

    • @djerebus
      @djerebus 3 ปีที่แล้ว

      I've been waiting for this. I love your teaching style and would easily pay for more content in php oop development

    • @kingshub3486
      @kingshub3486 3 ปีที่แล้ว

      Thanks for the video

    • @kingshub3486
      @kingshub3486 3 ปีที่แล้ว

      Thanks for the video

    • @gvks
      @gvks 3 ปีที่แล้ว

      Dani, how can I contribute just one time? Amazing videos....learned a lot. Thank You!

  • @lancemartija
    @lancemartija 3 ปีที่แล้ว +29

    Took me three days to finish your Object Oriented PHP Tutorial and man, oh man, did I learn more than what my uni professor is teaching us. Kudos to you and thanks a lot, sir Krossing! You are an inspiration to me. Keep on coding and I'll keep on following!

  • @alfie5652
    @alfie5652 3 ปีที่แล้ว +67

    Hi Daniel,
    I started watching your basic HTML & CSS courses about 2 years ago, after looking to move into front-end programming as a new career.
    2.5 years later I am now a mid-level front end developer in a fantastic career and on my way up.
    I want to owe a huge part of it to your early tutorials, making the learning process enjoyable, else I would have probably stopped very quickly.
    Love your content, keep it up :)

    • @JohnSmith-mm6hf
      @JohnSmith-mm6hf 3 ปีที่แล้ว +4

      Way to go Alfie !

    • @albedesigns
      @albedesigns 10 หลายเดือนก่อน

      That's really awesome!

  • @thenukawickramaarachchi6328
    @thenukawickramaarachchi6328 2 ปีที่แล้ว +13

    Hey Daniel.
    I wanted to thank you so much for your effort on these tutorials. Your HTML, CSS, JAVASCRIPT and PHP courses helped me to achieve higher marks in my Web design assignment. Your tutorials are the only things that I have looked upto and followed. You are a fantastic teacher. I don't normally leave comments in TH-cam but I wanted to thanku by leaving this comment to thank you for sharing your knowledge with everyone else. For anyone who look forward to learn and develop their skills on Web designing this is the place to learn.

  • @Rehaaabek
    @Rehaaabek 3 ปีที่แล้ว +52

    Great tutorial 🔥🔥 Here are couple ideas I'd love to watch
    1) CRUD
    2) Routing System
    3) Composer basics

  • @jammincoder
    @jammincoder 3 ปีที่แล้ว +9

    My gosh, man... I literally just finished the PHP login system that you posted on October 11 2020 yesterday, now you come out with this!!
    This is awesome!!

  • @CodeWithBehram7497
    @CodeWithBehram7497 10 หลายเดือนก่อน +1

    few years back became oop php developer watching ur old videos of oop php and i know ur channel is not in millions of subscribers but i like the way you teach and am also ur old subscribe 😊

  • @aijiexi
    @aijiexi ปีที่แล้ว

    I worked for a company that promised to train me to code if I dedicated 2 years to the company at an under-market wage in consideration of my training. I passed all of their pre-training modules and was hired...only to be fired after three weeks. I was devastated. I had already invested months of time and energy in their system, and I liked what I was learning. I wondered why I could not understand much of what the instructor taught when I could understand all of the previous modules I learned including OOP. I almost let myself believe I wasn't cut out for coding. After I watched your videos, I know I was bullied/discriminated against. You explained everything you did with the proper technical terms and explained at a fairly rapid pace. Yet, I understood exactly every step you took. With a bit of review, I am confident I can create a login system based on this and other tutorials you have prepared. Thank you. I will not go into all of the protected classes I belong to or begin a soap-box lecture on the state of the employment environment in STEM fields. Your videos have given me the steam to keep going. Again, thank you. I am now a subscriber.

    • @dotterel
      @dotterel ปีที่แล้ว

      Hey, I just read your story. Would you like to workin my company? It would be remotely as the job is in New Zealand. The first year will be an unpaid internship, but we promise the ability to grow into a six figure salary within the first 2 years of working with us. Let me know :). -Jamie, Backend Dev - Xero.

  • @jon82hill
    @jon82hill 6 หลายเดือนก่อน +1

    just spent the last hour trying to work out why there was an issue with my error handling only to find a silly typo!! it was still a productive hour as I now have a better understanding of what the code is actually doing. its nice to see even the pros make typos ;-) one of the things I like about your videos is that when you yourself make mistakes you explain later on in the video how you rectified them instead of just editing the mistakes out.👍

  • @em.pxthetic
    @em.pxthetic 2 ปีที่แล้ว +6

    Thank you for painstakingly explaining everything you do. I'm sure there are many people (like myself, a rookie) who feel anxious if we deviate from anything explained but you make it very clear what is important and not important to have copied exactly. Thanks dude!

  • @khwesigysst1838
    @khwesigysst1838 2 ปีที่แล้ว +6

    Hello Dani. You've been a great php teacher to me. Following your php tutorials I can clone unsplash with basic login system, sign up system, password reset, and how to upload files/photos. Thank you so much. But if you could show some love and do a video on php teaching us how to login with cookies and how to keep users logged in (remember me) with cookies. If nobody has asked u to. I hope you do one of your greatest fan this favor. Thank you so much Dani

  • @Big-Timbo
    @Big-Timbo 3 ปีที่แล้ว +10

    as always Dani, providing premium dev content for free, you've saved me so much through my uni course. Much love bigman

  • @woodzeppelin3241
    @woodzeppelin3241 2 หลายเดือนก่อน

    I figured out the errors by looking at the errors on the screen and where they are located. Very easy. Thanks for sharing your vast knowledge on this subject.

  • @jamalmammadzada9413
    @jamalmammadzada9413 3 ปีที่แล้ว +37

    rip to the people who did the tutorial in 2018, then realized there's a new one, AND right as they were finishing, this came out. LOL (totally not me)

    • @Dani_Krossing
      @Dani_Krossing  3 ปีที่แล้ว +7

      Hehe 😂 At least this one isn't just a "remake", and instead an actual OOP version. 😉

    • @emmanuelchukwuegbo961
      @emmanuelchukwuegbo961 2 ปีที่แล้ว +1

      Which is better please 🙏

    • @scoozilife
      @scoozilife ปีที่แล้ว +2

      @@emmanuelchukwuegbo961 depends on what your doing. Car is better gas mileage but your not gonna haul lumber with it 🤪
      Procedural programming in general can be better than OOP programming depending on what your doing. OOP provides "security" through classes as well as saves you from using duplicate code over and over again.
      Hope you can decide what's better for you!

    • @IfeyPrecious
      @IfeyPrecious 26 วันที่ผ่านมา +1

      Who else is coming 2024...well I know there is a new one but I purposely want to watch this before the new one... been new doesn't make it better sometimes

  • @deitunegold4593
    @deitunegold4593 ปีที่แล้ว

    spent a week going all over youtube trying to search for a better tutorial, ladies and gentlemen, this is it!

  • @Darkest-Kn1ght
    @Darkest-Kn1ght ปีที่แล้ว +1

    I've been watching your videos for quite some time now and I wanted to thank you for sharing your knowledge with us. When it comes to web dev, I don't think you're going to find any courses over at udemy that compare to yours, no matter the price. I'm currently 50 minutes into this video, and until you pointed some things out that you forgot to change, you lost me BIG BIG!! lol but now that you pointed those out, I'm going to go back and continue knowing what has to be changed. Thanks again for being patient in your videos and allowing us to type out everything and learn by doing.

  • @charmcaster2549
    @charmcaster2549 2 ปีที่แล้ว

    i just started php and watch almost playlist and write notes. and i can say im getting the hang of it thank you very much sir youre a great teacher

  • @Rafael-es5dp
    @Rafael-es5dp ปีที่แล้ว +2

    I'm so glad to see you doing tutorials about programming again. You're so easy to understand when explaining things. Thank you so much

  • @GodexWasTaken
    @GodexWasTaken ปีที่แล้ว +1

    Man you have no idea how much stupid mistakes i made. I Thought that it just doesn't work.. did not give up and learned so much, THANKS! Gonna keep going.

    • @Dani_Krossing
      @Dani_Krossing  ปีที่แล้ว +1

      Everyone makes mistakes while programming 🙂 Even the devs with 20 years experience. The important thing is to do what you did, and not give up, since it makes it easier and faster to recognize "what went wrong" next time. 😉

  • @kesemolatlhegi7108
    @kesemolatlhegi7108 ปีที่แล้ว

    this code works only if you are not lazy
    to find your typos
    the man is legit

  • @DanielL-t5h
    @DanielL-t5h ปีที่แล้ว

    This video is definitely worth watching for anyone new to PHP registration and login forms.
    It is simple, concise and very educational.

  • @collinswashington1216
    @collinswashington1216 3 ปีที่แล้ว

    Dani i have been following your causes for at least 1year now and you are the only youtube creator that i enjoy and understand very well .
    Am collins and 16years old from Africa .
    Your conte will make a big change in my life and i know it ani .and i wish i could help every month on brands now its just that am still in highschool .
    But i know one day i will my name will on you list of brands wt the end of the videos
    #love_u_dani_krossing

  • @a-factoracademy
    @a-factoracademy 2 ปีที่แล้ว +1

    Literally, this is one of the best PHP project video on TH-cam. Thanks Dani👍🏾💯

  • @horizon6309
    @horizon6309 6 หลายเดือนก่อน +1

    Brilliant video. Thanks for taking the time out to make this. I have learnt to build a login system in Node.js/Express using similar techniques, for one of my projects in the procedural way. But seeing this implemented in OOP is so much better. The code looks so much cleaner. I can now understand why OOP can be beneficial. The code is more organised and structured.

  • @HakanGalip
    @HakanGalip 4 หลายเดือนก่อน

    I learned more from your Video tutorials then from any other teacher. You are the best, thanks a lot...

  • @pixelrangerstudio86
    @pixelrangerstudio86 2 ปีที่แล้ว +2

    Dani! I followed all your PHP tutorials, very clear easy to follow and understand! I have some basic PHP knowledge already so this made my life easier. Thanks and please keep up the good work! Please release more like this. With these tutorials i managed to make a fully fledged login and register system. Only thing i am missing is 2FA. :)

  • @jamalmammadzada9413
    @jamalmammadzada9413 3 ปีที่แล้ว +3

    It's just crazy how this man is able to make such good videos, KEEP IT UP!

  • @mhendricks125
    @mhendricks125 ปีที่แล้ว +2

    Only 2k likes on thiis video?? smh this is the best PHP tutorials I've found so far and I have been LOOKING

  • @ThePancakeJedi
    @ThePancakeJedi 2 ปีที่แล้ว

    Dani, you are the best on the web imho. You've been teaching me for years and I keep coming back.

  • @krillinsworld9439
    @krillinsworld9439 ปีที่แล้ว

    Great tutorial despite the the errors crashing your system, we are only human after all, fantastic process just the same. I love your teaching methods and your sense of humor. You are cray just like I am. I had to watch this video again because I am new with working with OOP & PDO and I was not sure how to reference data pulled from the database column for further processing. Been working too much with procedural PHP. My mistake was with the multidimensional array reference ($user[0]['colref']) and because of this oversite, I threw away over 6 months worth of work. LOL Live and lean... Thanks Dani!

  • @DOTPIE
    @DOTPIE 7 หลายเดือนก่อน +1

    Thanks a lot for your work! I think this is the best tutorial I came across in a while, and I'm quite picky! I've been trying to find something that was more similar to the classes I'm having (just started learning php) so I can use it as supplement material for them. You present things very clearly 🤗

  • @christopher4088
    @christopher4088 3 ปีที่แล้ว

    When I’ve recently dust off the rust of my HTML and CSS skills, you upload a PHP video

  • @brangja4815
    @brangja4815 ปีที่แล้ว

    I just completed both of your php basic series. I just wanna say Thank you.

  • @JamerCatalla
    @JamerCatalla 4 หลายเดือนก่อน

    Hello, Dani I hope you're doing well. I wanted to take a moment to express my sincere gratitude for the course you provided. The level of preparation, effort, and dedication you showcased throughout was truly commendable. I appreciated it! Keep it up, Man!
    Again! Thank you, Dani!
    From PHP PDO Procedural to PHP OOP & MVC Pattern! Hooray! I can now start to create my personal project to apply and explore what I've learned.. :D

  • @stormybear4986
    @stormybear4986 2 หลายเดือนก่อน

    Dani, I am constantly amazed by the scope and breadth of your foreknowledge. You truly know your stuff! Your presentation style is very approachable and easily understandable. you are a better teacher than college professors I've had who have decades of professional experience teaching. Where did you get your education? because Iwant to go there to study so I can be as smart as you.

  • @i.t.starters2019
    @i.t.starters2019 3 ปีที่แล้ว

    Been waiting for this tutorial for over a year now and finally came. I appreciate you man, thank you so much. Love from South Africa. 🇿🇦🇿🇦

  • @obsidian314
    @obsidian314 ปีที่แล้ว +1

    Great tutorial. I love your teaching style. I also love that your transparent with your typos and mistakes. Helps me know that its just part of coding.

  • @fiskegalen1
    @fiskegalen1 2 ปีที่แล้ว +1

    I'm totally new to PHP and I got this working perfectly. Thank you from Sweden!!! :)

  • @rangingaway92
    @rangingaway92 ปีที่แล้ว

    I use pdo for procedural php as well. Zero issues, works like a charm. So don't know why you say that. Other than that great video! Helping my php OOP.

  • @DolchstarLP
    @DolchstarLP 3 ปีที่แล้ว

    I had an Error called :
    Error!: could not find driver.
    Found the Solution immediatly. I thought mysql is deprecated in the connect method so i wrote mysqli. But then i got this Errormessage.
    An employee told me a few minutes ago, that the mysql in the connect isnt for using. Its just for the driver.
    PS: I started with OOP today and then i found ur Video with a login system in OOP. I build one in PP but now i wanna change everything to OOP. And ur tut was a good start to understand what about Classes, Error Handlers and inheritance.
    I am happy that atleast ur YT Videos are free. (like u said they could be for $15 on udemy.) Just do like u did before. U do well. Since my internship i watched like 10 videos of urs and learned so much more than in my 14 month retraining.

    • @crymerxs29edition
      @crymerxs29edition 2 ปีที่แล้ว

      What was the solution?

    • @DolchstarLP
      @DolchstarLP 2 ปีที่แล้ว

      @@crymerxs29edition i changed mysqli to mysql. I just deleted the i after mysql

  • @lancewilliamcatal6870
    @lancewilliamcatal6870 3 ปีที่แล้ว +7

    Well whaddaya know. Just what I need.
    You never disappoint, Dani.

  • @HTswahili
    @HTswahili 3 ปีที่แล้ว

    Here from Tanzania
    I become pro in PHP via the channel... thanks so much💪💪

  • @jerrywalz6308
    @jerrywalz6308 6 หลายเดือนก่อน

    I did everything how you did it Dani, but to get it to completely work all I had to do was change the last select stmt from (SELECT `users_pwd` ...) to (SELECT * ...) in the login.classes.php file to effect the super global values, then it worked. The only other potential typo that I saw in the Video was the "loginContr" class to "LoginContr".

  • @onee
    @onee 2 ปีที่แล้ว +1

    Finally managed to run it successfully! Mine doesn't look as good as yours, but it does the job, and that's what counts. :)
    For the people who claim to have done everything like Dani, but still get errors, make sure to actually read those errors. They often point you to the right line. And even if you think your code is the same, you might make small mistakes here and there. So, read your code carefully. Like I once wrote user instead of users. And once used a $ sign where I shouldn't use it. These are just small errors, but it can break your entire code.

    • @netramc5123
      @netramc5123 2 ปีที่แล้ว +3

      I'm not getting any errors!
      My sumbit redirects the index page to the singup.inc.php without any errors which is odd..
      This happens when I'm trying to sing up a new user, nothing's happening no errors but also no new user added to the database.

    • @seyedparsasedighi6990
      @seyedparsasedighi6990 ปีที่แล้ว

      @@netramc5123 how did u fix it bro im so stuck 😭😭

    • @markludwig5805
      @markludwig5805 ปีที่แล้ว

      Same exact issue here. Not sure how to track this down.

    • @neocrumbs2508
      @neocrumbs2508 ปีที่แล้ว

      @@netramc5123same how did you fixed it?

  • @RomanBehroz
    @RomanBehroz ปีที่แล้ว

    Well thank you for the effort, nice video for beginners. Important thing about inheritance is, I mean when he uses extends, it is not totally correct how he uses it. Well it works But...! When a class extends another class, it means the class is now a child of that class which he extended. So making your controller extend your model class, doesn't really make sense because they are two different things and have different purposes. A better way is to use composition, which means to create an object of your signup model in your controller constructor and then access the methods of the signup class through your created object.

  • @GRAdiaforos
    @GRAdiaforos 3 ปีที่แล้ว +2

    Great Video Dani !
    It will be very interesting (after your mvc project), to create a complex registration form, based on mvc, with ajax autoloaders, warnings, error handlers, client & server-side validation for dates, emails, integers, strings etc...

  • @stephenokoduwa
    @stephenokoduwa ปีที่แล้ว

    Dani is the professor I wish I had in my years in University. Great tutorial!

  • @randyhopkins9895
    @randyhopkins9895 2 ปีที่แล้ว

    Howdy Dani, works great, no errors! also added users_address to further the use for a new family site where it goes to profile page to view users info and buttons to a family gallery page and an auction page. Great Job. two thumbs up !!

  • @chyjohn6502
    @chyjohn6502 2 ปีที่แล้ว

    Thanks a lot Daniel for these videos, asides the videos in this series, I've actually learnt a lot from your tutorials over the years. I know no one asked, but my first ever loginsystem, around 2019 was with your video.. lool... Now like before, you've contributed again towards helping me transition gradually to oop. Thanks a lot man. Thank you. I really do hope to become a pro like you someday. 😊

  • @astratow
    @astratow 3 ปีที่แล้ว +1

    Splendid video! And valuable comment about possible errors! Absolute gem in the world which tries to ignore PHP. Thank you Dani!

  • @MightyKingKala
    @MightyKingKala 3 ปีที่แล้ว

    Bro I just wanna say that I love you, you are doing priceless work and you have best PHP tutorials .

  • @lucacerciello6122
    @lucacerciello6122 2 ปีที่แล้ว

    Thanks a lot Dani! I'm teaching myself coding and you became like a guru for me.

  • @poh3310
    @poh3310 5 หลายเดือนก่อน +1

    Thank you my friend for guiding me through the oop world

  • @randalfjohn9848
    @randalfjohn9848 2 ปีที่แล้ว

    You're the best as far as PHP is concerned. You're the absolute best.
    I have been running from OOP, but damn you just make it look so so easy.

  • @schlossguide
    @schlossguide 3 ปีที่แล้ว +1

    Thanks for the tutorial... it's great and functional out of the box. There are a few typos in there, but if you are able to follow your lead, you should be able to correct them on your own. Thanks again!

  • @lucasjosueguerrapontelli30
    @lucasjosueguerrapontelli30 2 ปีที่แล้ว

    Lo escribo en español para que se diviertan traduciendo:
    Muchas gracias por todos tus conocimientos; he interpretado cada concepto y lo he aplicado con "mis palabras", o a mi manera, y son muy útiles en los programas que estoy haciendo.
    Es invaluable la calidad de contenido que expones, muchas gracias nuevamente!
    Saludos desde Argentina!

    • @Dani_Krossing
      @Dani_Krossing  2 ปีที่แล้ว

      De nada. Me alegra que hayas disfrutado de mis videos. :)

    • @johnsmart1823
      @johnsmart1823 ปีที่แล้ว

      @@Dani_Krossing I need a php mentor that will give me tasks, work on projects.. Any advice please

  • @1ЗЗ7
    @1ЗЗ7 2 ปีที่แล้ว

    i forgot a -> and holy it took me long to find the issue haha. great tutorial man i'm currently taking a speedcourse in OOP PHP and this helped me understand my homework alot better.

  • @laravelpixels6935
    @laravelpixels6935 3 ปีที่แล้ว

    I love how dani explains things

  • @bryebolony
    @bryebolony ปีที่แล้ว

    Hi Dani, thank you for the incredible content you provide on your channel. Your classes have been extremely helpful and have had a significant impact on my learning journey.
    Your dedication to teaching and sharing your knowledge is truly inspiring, and I am grateful for the time and effort you put into creating your videos. Your explanations are clear and concise, making it easy for me to understand even the most complex topics. 😊

  • @yeapxiangwei6320
    @yeapxiangwei6320 3 ปีที่แล้ว

    I'm just watching your 1st video of create login system by php, and I'm going to watch your second video of login system, now is coming out a new video of create login system🤣🤣

  • @imadel3647
    @imadel3647 3 ปีที่แล้ว +6

    Super great !!!
    We need more content like that i love the feeling when i watch your pragramming tutos
    Thank you so much #Dani 😁

  • @smart4252
    @smart4252 2 ปีที่แล้ว +6

    First of all: Thank you so much for this video. It helped me a lot!
    But there is one thing: I might be wrong but the SQL-Requests in your login.classes.php might be a little buggy? I realized it after taking my email istead of my username to log in, which failed.
    I guess on line 8 it should be array($uid, $uid) instead of array($uid, $pwd), because we check for the username or email.
    On line 31 it seems like requesting again only username or email should be okay, as we checked the correct password before and the $pwd on line 33 is not equal to the hashed pwd in our database. Instead the SQL-Requests checks only for a correct username (rowCount equals 1) OR for correct email and password (rowCount equals 0, because the $pwd is not hashed).
    Again: I might be terrible wrong... just trying to understand it.

    • @hobbydilettant9549
      @hobbydilettant9549 2 ปีที่แล้ว

      Same😅

    • @khaledn3867
      @khaledn3867 2 ปีที่แล้ว +1

      I am having the same issue with the login class.

    • @thalison-dev
      @thalison-dev 2 ปีที่แล้ว

      Did you find a solution?

    • @aasoftware404
      @aasoftware404 2 ปีที่แล้ว +2

      remove password condition on line 31 query and it works both username & email because password has already checked on line 30

    • @photoinshot1355
      @photoinshot1355 ปีที่แล้ว

      Did anyone find a solution that works? I have tried all the ideas below but will not accept email to login with.

  • @GigaChad-qp3xf
    @GigaChad-qp3xf ปีที่แล้ว +1

    Dani: So just to make it A LOT FASTER, I'll copy everything from another class and paste it in here...
    Also Dani: Deletes everything except "class {}" (0_0 ' ) 25:23
    Love you man XD

    • @Dani_Krossing
      @Dani_Krossing  ปีที่แล้ว +4

      I was WAITING for someone to comment on it 😂 When I deleted everything, I realized how dumb it was.

  • @SwenTeMebel
    @SwenTeMebel ปีที่แล้ว

    You realy helped me out with some OOP! nice example with the login system! Realy nice! Thanks again

  • @andresjacome2243
    @andresjacome2243 3 ปีที่แล้ว

    Dani: **explains the things people get confused about (CSS files, naming conventions, etc)**
    Me, who watched the procedural login system video literally 5 hours ago: heh, plebs.

  • @Michael-lo3ht
    @Michael-lo3ht 9 หลายเดือนก่อน

    I constantly pull up this when I'm watching these. It helps burn it in to my head, if it finds it's place. lol
    Name Function
    Model Connects to the database
    Views Grabs the data from database and displays to the user
    Controller Controls the input from the user

  • @bhgur84
    @bhgur84 3 ปีที่แล้ว +2

    Thanks Dani. Another great tutorial and again very well explained. Honestly I am very glad about the few typo's. I think this way it is more educating and also gives me hope since I make so many typo's myself :-) I can follow up on one of the previous comments and would love to see a PHP OOP CRUD application with an upload function for .PDF files. Thanks again.

  • @Big-Timbo
    @Big-Timbo 3 ปีที่แล้ว +1

    Hi Dani, I'm sure I'm not alone in this, but I made quite a few mistakes and fell into despair. So I had to bounce around the vid to double-check different parts as I went along. I would be so grateful if you could add timestamps to help anyone else also suffering from their own mistakes :D Cheers bro

    • @Dani_Krossing
      @Dani_Krossing  3 ปีที่แล้ว +3

      You are right, that would improve things hehe. I'll get around to it when I get back to my office ;)

  • @Darkest-Kn1ght
    @Darkest-Kn1ght ปีที่แล้ว

    When Dani says 90 percent of the time there is some type of typo causing issues, he's spreading truth. I just figured out why I was getting the errors with empty input. In the signup contr classes file, down in the private function emptyInput I had only put the 'empty' in front of the very first submitted value. I can't believe I missed that one little thing for that long!

  • @hamidsarwary1872
    @hamidsarwary1872 3 ปีที่แล้ว +1

    Excellent videos man, you're a true hero and a great mentor. PHP finally make sense. I wonder if you have any plans for creating videos on how to further use this login system? Such as resetting, editing profile details, and data relations the oop way?

    • @hamidsarwary1872
      @hamidsarwary1872 3 ปีที่แล้ว +1

      And of course some security measures would be interesting

  • @AozenDreyar
    @AozenDreyar 2 ปีที่แล้ว

    my brain fried at around 40 minutes but yes sitting 1 hour through any tutorial is not easy XD but i love your content

  • @itwebadmin
    @itwebadmin 3 ปีที่แล้ว

    Yeah we need more PHP, that login tut from last year put me on the map when I started Laravel PHP...I was worried there for a sec, like you had switched professions...Like a pro gamer or something...

  • @emilandersen6865
    @emilandersen6865 3 ปีที่แล้ว +2

    Hi Dani. Thanks for making this video. Why don't you use frameworks such as React?

  • @madhawapiumika4037
    @madhawapiumika4037 ปีที่แล้ว

    Reaaaaaalllly Nice vid.. Thanks. I'm starting to Dump partial Procedural and go full on with OOP

  • @spiuncom
    @spiuncom 2 ปีที่แล้ว

    Its was a great tutorial in OOP PHP, i was able to learn and understand alot since i had done only procedural PHP more then 10 years ago and then i was off programming for such a long period.
    However i must express my criticism for using too many IF-Else statements in the login code.
    Thank you once again Daniel for the amazing videos.

    • @Dani_Krossing
      @Dani_Krossing  2 ปีที่แล้ว

      I’m glad you enjoyed it. 🙂 I’d love to know why you find there being too many else/if statements?
      The only other ways I can think of, is splitting the error handlers into separate methods for reusability. But even so the if statements would still be there. And using switches isn’t appropriate in this situation, since they are used to branch the code, and not check for conditions in this way.
      The conditions need to be checked somehow, otherwise we wouldn’t be running any error handlers. And I can’t see it being done more simple than what I did in my video. So if you have a better way to do it, I’d love to learn from it. 🙂

    • @spiuncom
      @spiuncom 2 ปีที่แล้ว

      @@Dani_Krossing WOW Thanks for the reply first of all, i really appreciate you found the time to reply to my comment in such short time frame. Here is my reply:
      - I would have set the input field to "required" in HTML tag to avoid isEmpty() method.
      - to avoid invalidEmail() method and so on.
      - And of course why not implement Auto Load classes in the project (Lesson 9)
      Is thee a way to avoid IF-Else implementing Interfaces in this case? or Try & Catch ?

    • @Dani_Krossing
      @Dani_Krossing  2 ปีที่แล้ว +2

      Ah I see what you mean by limiting if/else then… And it’s very important I tell you why I didn’t do those things, so you don’t do it in your projects. 😅
      It is VERY important you don’t use HTML attributes like “required” or “email” for security. 👈
      In all modern browsers there are build in developer tools, which can VERY easily bypass HTML and JavaScript. You should ALWAYS use PHP (or any other backend language) for security checks, since they run on the server side and can’t get accessed/manipulated by the user.
      You can actually test this in 2 secs by simply right clicking your login form in the browser, then select “inspect element”, and then simply remove any HTML attributes. Never use front end for security.
      In regards to autoload, I simply forgot to include it into this project hehe (whops). 😅
      In regards to try/catch vs if/else, it is also worth noting that try/catch is used for testing, or to catch exceptions. Where as when you wanna check for conditions, then you use if/else. 🙂 So essentially, you will be using if/else most of the time.

    • @Dani_Krossing
      @Dani_Krossing  2 ปีที่แล้ว +2

      And to answer the question, “why does the HTML required attribute exist in the first place then?”…
      My best guess is that it is a old outdated leftover attribute from MANY years ago, which now only exists because older websites uses it, meaning they can’t just remove the browser support for it without it breaking existing websites.
      I honestly don’t think it should exist hehe. I often get people telling me about using “required” in the comments instead of PHP, not knowing how insecure it actually is. Which tells me that A LOT of developers might make websites that are insecure. 😅 So in my opinion they should just remove the attribute entirely…

    • @spiuncom
      @spiuncom 2 ปีที่แล้ว +1

      @@Dani_Krossing You are right about the security issues and developer tools, have been using them even to reveal password on my ISP routers :) .
      Keep it up with the tutorial, you have a "gift" to transmit your knowledge to your viewers. Ohhh btw it would be cool to see some blockchain programming in the future on your channel.

  • @jasongrant2366
    @jasongrant2366 3 ปีที่แล้ว

    Glad you're back at it

  • @WillemsWimMH
    @WillemsWimMH 7 หลายเดือนก่อน

    First off: great vids with lots of super useful information.
    I have some question though on the code here. Maybe it has been addressed but I did not find it.
    Specifically to login the user (at approx 1:02:00). The "SELECT * ... WHERE ... users_pwd = ?" will it work to select the right user from the table? Isn't the password hashed in the table and $pwd (as input) is not hashed. So I guess the query will give an empty result, no?

  • @b391i
    @b391i 3 ปีที่แล้ว

    Thanks dude this login system with OOP is incredible 👏

  • @alejandropech6219
    @alejandropech6219 2 ปีที่แล้ว

    Hi Dani, nice lesson... do you recommend use ajax to handle error inputs instead handle in the classes? thanks

  • @ionrobert8933
    @ionrobert8933 2 ปีที่แล้ว

    If you're a complete beginner to soft production then soft is imo the easiest daw that you can get, I started off with it.. If you have a little bit

  • @benbotch1746
    @benbotch1746 3 ปีที่แล้ว

    Great work Dani 👍 much love from Ghana 🇬🇭😊

  • @scott-richardson
    @scott-richardson 2 ปีที่แล้ว

    Another awesome tutorial Dani. Although my takeaway from this is this: absolutely much more sensible, minimal code when using procedural. There is a tendency for coding 'snobbery' to turn their nose up at procedural, but from a purely objective view (lol), procedural is cleaner, and less code.

    • @Dani_Krossing
      @Dani_Krossing  2 ปีที่แล้ว +2

      People shouldn't think of it is "Procedural vs. OOP" since they both have pros and cons. Each has their own place in the programming world. 🙂
      And you are right that there is a tendency for "code snobbery" hehe, and I have experienced my fair share of it. There is always this... "I'm smarter than you" feeling when a OOP "expert" tries to teach someone OOP.
      However, people should also be careful of not seeing the benefits in OOP. 🙂
      If I was forced to use only one, I would any day pick OOP since it is much better structured. The whole idea of code being more "minimal when Procedural", only counts for small - medium sized projects. And OOP may appear more complex, but once you have the foundation set up it gets much faster and simpler to use than Procedural.
      There are many drawbacks from using Procedural in large projects, and it gives me nightmares thinking of trying to make a large application only using Procedural. 😅
      So my take on this, is to not see them as "either or", but as two tools at your disposal. 🙂 Each do better at different things, and forcing yourself to only use one of them in every project, would be to limit yourself.

    • @scott-richardson
      @scott-richardson 2 ปีที่แล้ว

      @@Dani_Krossing Well said, and totally agree Dani. I think I am fond of functional procedural programming in PHP purely because it's something I have honed my skills at over a long time, and like to think I can produce pretty nicely structured sites/apps using this style. But I am intrigued by the OOP concepts - and sometimes do include some OOP classes in my projects with no issue.
      I would like to give some of these OOP methods a go in some of our custom PHP frameworks we're building and see what works best for us.

  • @simsolchannel
    @simsolchannel 2 ปีที่แล้ว +1

    Hello teacher, my name is Sim Sol from Cambodia, in this lesson I want to know more than any other lesson ... So please give me a presentation again and again to get me the basics. Foundation ... Thank you teacher and wish you good health ... !!

  • @MrTimm
    @MrTimm 2 ปีที่แล้ว

    great video, i was able to convert my plane PHP code to proper PHP code.

  • @cryptoknight7256
    @cryptoknight7256 2 ปีที่แล้ว

    What is the difference between using/importing classes and including a file containing all the functions you need? Thanks for what you do!

  •  3 ปีที่แล้ว

    I'm learning a lot from you.
    Just so you know.

  • @charaf-eddinehasnaoui4238
    @charaf-eddinehasnaoui4238 2 ปีที่แล้ว +8

    57:17 L 8- $stmt->execute(array($uid,$uid)
    1:02:54 L33- $stmt->execute(array($uid,$uid,$pwdHashed[0]['users_pwd']))

    • @charaf-eddinehasnaoui4238
      @charaf-eddinehasnaoui4238 2 ปีที่แล้ว +3

      1:02:54 L31 SELECT * from users WHERE (users_uid=? OR users_email=?) And users_pwd=? ;

    • @charaf-eddinehasnaoui4238
      @charaf-eddinehasnaoui4238 2 ปีที่แล้ว +2

      Excellent videos

    • @Alexmofu98
      @Alexmofu98 2 ปีที่แล้ว +1

      @@charaf-eddinehasnaoui4238 Saved my life with that, thanks!

    • @khaledn3867
      @khaledn3867 2 ปีที่แล้ว

      @@charaf-eddinehasnaoui4238 Thank you very much, this resolved my problem. I hope @Dani Krossing could promote this comment.

    • @CrowmanGR
      @CrowmanGR 2 ปีที่แล้ว +1

      Saved my life thank you!

  • @mounir101
    @mounir101 3 ปีที่แล้ว

    It is a very helpful video and I really like your tutorials. Keep going:) and thanks so much, Dani.

  • @royssansalinas2125
    @royssansalinas2125 3 ปีที่แล้ว

    Thank you so much for this, but I still have an error. just try to figure it out myself, thank you again DANI!! you are the best.

  • @harveyravencatipay9100
    @harveyravencatipay9100 2 ปีที่แล้ว

    Hi! I need help. Beginner here.
    Just wanna ask about the setUser function. What does it mean when you set $stmt=null? how does it affect the database?
    Your tutorials are amazing btw!

  • @saffron6661
    @saffron6661 3 ปีที่แล้ว

    LOL just recently I think I remember asking for an OOP tutorial from you, thx Dani, next JavaScript or working with Frameworks plz !! :D

  • @almojaiderbakal3529
    @almojaiderbakal3529 3 ปีที่แล้ว

    Thank you for making this video available and free.

  • @BarnabyPerrinAldous
    @BarnabyPerrinAldous 2 ปีที่แล้ว

    Another great tutorial! Worked for me! Nice one bro!

  • @hayatzee8830
    @hayatzee8830 2 ปีที่แล้ว

    So much gratitude here for you.

  • @CallmeDou
    @CallmeDou 4 หลายเดือนก่อน

    thanks for the videos, but i do have one question why would you not include a source for the starting code(index and style), so that new learners can easily follow along exactly the way you do it

  • @moisescastillo3447
    @moisescastillo3447 3 ปีที่แล้ว

    Dani, what a good video, thanks for this quality of material, please continue to share your knowledge in this way about opp php pdo, I like the didactic way you explain, I will be anxious waiting for the next thing you will upload

  • @keithrogerseventphotograph9193
    @keithrogerseventphotograph9193 ปีที่แล้ว

    Great tutorial, saved in my playlist. Thank you!

  • @OPGAMER.
    @OPGAMER. 3 ปีที่แล้ว +1

    Wow this video has more views than usual.. 🙂🙂
    I Hope you will upload more videos

  • @akt8892
    @akt8892 2 ปีที่แล้ว

    I just wanna say THANK YOU!

  • @AlexanderNielsen1
    @AlexanderNielsen1 2 ปีที่แล้ว +1

    Hey Dani, Great video as always, but i have a problem with my result and resultcheck not working it says that its is a Undefined variable. Any tips?