Results 1 to 1 of 1

Thread: php session variable pains, is this right?

  1. #1
    Join Date
    Dec 2006
    Beans
    Hidden!

    php session variable pains, is this right?

    I have 2 forms
    first one was called mysearch2.htm
    I had to rename to mysearch2first.php !!

    and put this code in it to eliminate the session vars??
    I had to unset first, otherwise they were not destroyed.

    <?php
    session_start();
    unset($_SESSION['wo1']);
    unset($_SESSION['wo2']);
    unset($_SESSION['wo3']);

    unset($_SESSION['ws1']);
    unset($_SESSION['ws2']);
    unset($_SESSION['ws3']);
    unset($_SESSION['ws4']);

    session_unset();
    session_destroy();
    $_SESSION = array();
    ?>
    I use these session vars in mysearch2.php
    in mysearch2first.php, a user inputs some search words
    mysearch2first then goes to mysearch2.php and $_POST is used to pull the various words to search.

    then mysearch2.php calls itself over and over and needs to reuse those search words in queries, etc....

    what happens if I want a third page called mysearch3.php, how can I even consider using session vars since I cant destroy them and use them at the same time?
    What to do?
    Last edited by sdowney717; January 23rd, 2011 at 12:50 AM.

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
  •