How To Control User Access in a PHP Application

Поделиться
HTML-код
  • Опубликовано: 18 окт 2019
  • In this video we review code that allows us to restrict unauthorized users from accessing specific pages on your website.
    Full Course
    Udemy (Discount Coupon Attached): bit.ly/udemy-modern-php
    SkillShare (2 Months Free Premium Access): skl.sh/3897t8m
    ___________________________________________________________________
    I am a Software Engineer and Instructor. I can provide professional development services or private code coaching sessions to help you to accomplish your profesisonal or personal IT goals.
    Check out my content on Social Media
    Website: www.trevoirwilliams.com/
    Instagram: / trevthetrevwill
    Facebook: / trevoirwilliams
    LinkedIn: / trevoirwilliams
    Check out some free courses below:
    Microsoft SQL Server 2017 for Everyone! - Database Development Course
    • Microsoft SQL Server 2...
    PHP Bootstrap 4, Heroku and MySQL Course
    • PHP Bootstrap 4, Herok...
    PHP Development with Bootstrap, GitHub and Heroku
    • PHP Development with B...
    Modern PHP Web Development with MySQL, GitHub and Bootstrap 4
    • Modern PHP Web Develop...
    C# - Basics Uncovered
    • C# - Basics Uncovered
    Enterprise C# Winforms Application Development
    • Enterprise C# Winforms...
    Introduction To Website Technologies
    • Introduction To Websit...
    Check out my premium courses on Udemy
    End to End ASP.NET Core 3.1 API and Blazor Development
    www.udemy.com/course/end-to-e...
    C# Console and Windows Forms Development with LINQ & ADO.NET
    www.udemy.com/course/c-consol...
    Complete ASP.Net Core 3.1 and Entity Framework Development
    www.udemy.com/course/complete...
    Modern PHP Web Development w/ MySQL, GitHub & Heroku
    www.udemy.com/course/advanced...
    Microsoft SQL Server Development for Everyone!
    www.udemy.com/course/microsof...
  • НаукаНаука

Комментарии • 38

  • @nadinev65
    @nadinev65 3 года назад +3

    You are a complete legend Trevoir. So simple a fix and really well explained. Cheers mate.

    • @TrevoirWilliams
      @TrevoirWilliams  3 года назад

      I am happy to be able to help Terry. Thanks for the endorsement !

  • @marias3457
    @marias3457 3 года назад +3

    Very well explained! Thankyou for not having too much fluff that is too common in tutorial videos. Even not having the rest of the pages available, I was still able to implement this correctly.

    • @TrevoirWilliams
      @TrevoirWilliams  3 года назад

      Thats great to hear Maria. I always try to keep it simple and functional. I am glad you liked it.

  • @liviubarburo
    @liviubarburo 2 года назад +2

    Wow! Man you are a great teacher! You explained the session auth so clear and fast … Thank you!

  • @somdusazerate
    @somdusazerate 3 года назад +2

    top job, man. saved me a lot of trouble. you won't believe how hard it is to find clear guides to do this!! I googled for like 2 hours collectively

    • @TrevoirWilliams
      @TrevoirWilliams  3 года назад

      Thanks for the endorsement. I am glad this video helped!

    • @somdusazerate
      @somdusazerate 3 года назад +1

      @@TrevoirWilliams yeah, man, it's a simple thing for sure for someone who knows this stuff, but I'm rather old at 30 years old getting into this and there has been no one to exactly show me how to do this. also a lot of good content, your work does not go unappreciated 👍

    • @somdusazerate
      @somdusazerate 3 года назад +1

      and obviously subbed!

    • @TrevoirWilliams
      @TrevoirWilliams  3 года назад

      I appreciate it man. If you have any suggestions or requests, just let me know

  • @clintonbrown4235
    @clintonbrown4235 Год назад +1

    Passing information fast and simply 👍

  • @nestahmaedelosreyes1825
    @nestahmaedelosreyes1825 3 года назад +1

    Omg, finally, you saved me sir! Thank you so much!

  • @emilypayne1855
    @emilypayne1855 Год назад +1

    Thank you so much, your tutorials are awesome

  • @tyronetaylor5928
    @tyronetaylor5928 4 года назад +1

    Really great videos...could you do a video on roles...anxiously anticipating...

    • @TrevoirWilliams
      @TrevoirWilliams  4 года назад

      Hey Tyrone, this is a good suggestion. I will do one soon.

  • @valentincvc
    @valentincvc 3 года назад +1

    Thank you for help!

  • @visualdad9453
    @visualdad9453 3 года назад +1

    thank you :)

  • @micahemmanuel7580
    @micahemmanuel7580 2 года назад +1

    Thanks for this tutorial.
    Thanks.
    My own issue is that when I login it will say login successful and hang there without redirecting me to the dashboard.
    How can I fix this issue?

    • @TrevoirWilliams
      @TrevoirWilliams  2 года назад

      Can you share the redirect code? The error might be in how it was written

  • @meghapatel3928
    @meghapatel3928 3 месяца назад

    how to do this thing on particular button
    Likewise the user just wants to visit website

  • @despitegfx
    @despitegfx 4 года назад +1

    hi, I really have a challenge here. This work perfect on localhost but the restricted page doesn't show if i upload my files to the cpanel. It keeps showing the login page after entering the correct login credential. Can you help me out?
    :)

    • @TrevoirWilliams
      @TrevoirWilliams  4 года назад +1

      Hello, are you changing out the connection string to reflect the remote database and if yes, then are you sure that the same users exist on both side with the same password?

  • @aseemanand4030
    @aseemanand4030 3 года назад +1

    what if i open the application and login in some other browser....? this won't prevent me from logging in again there using same creds!

    • @TrevoirWilliams
      @TrevoirWilliams  3 года назад +1

      Hello Aseem. This very simple implementation will not prevent that. That will require more complex checks to ensure that doesn't happen.

  • @ashwithbhatt6406
    @ashwithbhatt6406 2 года назад +1

    But one problem I am facing that if someone gets logged in then if by other tab we try to access that page it gets accessed why?

    • @TrevoirWilliams
      @TrevoirWilliams  2 года назад +1

      Ashwith, The session you create is stored by the browser, so it will remember that it is signed in. You would need to enhance the login approach to do other things.

  • @gideonhayford87
    @gideonhayford87 19 дней назад

    my own doesn't access ooo

  • @perperikis5501
    @perperikis5501 Год назад +1

    Dumb question: What prevents a user that logs in with a valid sesion, to modify - by using the browser tools - the value of userid in order to act as a different one ?

    • @TrevoirWilliams
      @TrevoirWilliams  Год назад

      There are no dumb questions. The user id value is stored as a session, which is stored on the server. Without direct access, this will not be very easy to do. That being said, you have valid security concerns and there are certainly better ways to handle authentication scenarios.

    • @perperikis5501
      @perperikis5501 Год назад

      @@TrevoirWilliams Thank you very much for the straight forward reply. Not being stored on the client side is reassuring as I'm using such an authentication and deciding post-login what to show on the page, according to user logged in. It wouldn't do if a user could impersonate another.

  • @Samuel-ns5jb
    @Samuel-ns5jb Год назад +1

    Can we get the source code?

    • @TrevoirWilliams
      @TrevoirWilliams  Год назад

      You can find the course code here: github.com/trevoirwilliams/attendance-php

    • @Samuel-ns5jb
      @Samuel-ns5jb Год назад

      @@TrevoirWilliams thank you.