SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Evangelist
    Join Date
    Mar 2008
    Posts
    551
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile Session exists then include page

    Hi all,
    On the index.php page we have:

    PHP Code:
    <?php
    session_start
    (); // start up your PHP session! 
    ?>
    Then on the inside page we have been using a url which for many reasons is not what we want. How can we include the thetable.php if the session exists? Thank-you!:
    PHP Code:
    <?php 
     
    if (isset($_GET['front']) && $_GET['front'] == '1') {include("thetable.php");}
      
    ?>

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    On index.php put something in the session:
    PHP Code:
    <?php
    session_start
    ();
    $_SESSION['front'] = true;
    ?>
    On the inside page, check if that value exists, indicating the previous code ran
    PHP Code:
    <?php
    session_start
    ();
    if (isset(
    $_SESSION['front']) && $_SESSION['front'] == true) {
      include(
    "thetable.php");
    }
    ?>


Bookmarks

Posting Permissions

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