Results 1 to 4 of 4

Thread: [RESOLVED] Trouble with Session Vars

  1. #1

    Thread Starter
    Addicted Member kzatu's Avatar
    Join Date
    Aug 2003
    Location
    Nevada
    Posts
    148

    Resolved [RESOLVED] Trouble with Session Vars

    I've simplified my code for this thread. All I'm trying to do is echo the Session_Vars in a seperate function. Is there anyway to make this work?

    test1.php
    PHP Code:
    <?
      session_start();
      $HTTP_SESSION_VARS['test'] = "Hello World";
      require('test2.php');
      test();
    ?>
    test2.php
    PHP Code:
    <?
      function test() {
        echo 'HTTP_SESSION_VARS='; echo $HTTP_SESSION_VARS['test'];
      }
    ?>
    Changes are not permanent, but change is. {Neil Peart}

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Trouble with Session Vars

    $HTTP_SESSION_VARS is deprecated. Use $_SESSION instead.

    If you want to dump all the sessin vars yuo can do in very isliey:
    PHP Code:
    print_r($_SESSION); 

  3. #3

    Thread Starter
    Addicted Member kzatu's Avatar
    Join Date
    Aug 2003
    Location
    Nevada
    Posts
    148

    Resolved Re: Trouble with Session Vars

    That works great! Thanks!
    Changes are not permanent, but change is. {Neil Peart}

  4. #4
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: [RESOLVED] Trouble with Session Vars

    No porblems

    print_r() will dump jsut about any type of variable, very useful for debugging.

    Srry about all the spellos. Its' 2 degrees and my hadns are falling foff

Posting Permissions

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



Click Here to Expand Forum to Full Width