Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Nov 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    how to add checks for accessing the pages

    hi!
    i am working in php. i want to know how can i add checks. like if a user is not login then he can not viwe some pages.
    is question clear??

  • #2
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,073
    Thanks
    11
    Thanked 98 Times in 96 Posts
    lots & lots of ways , a simple example would be to use sessions or cookies, create a session or cookie variable when the user logs in then check for that variable on any secure pages..

    PHP Code:
    session_start();
    if(!isset(
    $_SESSION['auth']['id'])){
     
    header('location: login.php');

    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •