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
    Sep 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post Help with authentification

    I have setup my login, register, logout pages which all work fine.

    Login is assigned as index.php

    I'm finding that I am stuck on what to do next. I need to have a page where logged in users can view.

    Can anyone help?

  2. #2
    Supreme Master coder!
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    10,216
    Thanks
    10
    Thanked 1,168 Times in 1,159 Posts
    When they logged in, what is the name of the SESSION variable you created?

    Say that when they logged-in, you set a SESSION variable like this:
    $_SESSION['loggedIn']="OK";

    You put this at the top of any page (PHP script) you wish to protect.
    <?php
    session_start();
    if(isset($_SESSION['loggedIn'])){
    //do nothing
    }
    else{
    header ("location: index.php");
    }


 

Tags for this Thread

Posting Permissions

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