Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2006
    Posts
    11

    Unanswered: Session and global variable question

    Regarding the session_start(); , is it that I need to include this on very top of the page where I going to use $_SESSION variable? And, I would like to create a variable that all other page can have access into it, and I woundn't want to use $_SESSION, since it will be erased if the browser clear the history or clear the session, besides using include and add a hidden field in a form, is there any global variable in PHP that allow me to do so? Thanks.

  2. #2
    Join Date
    Apr 2006
    Location
    Denver, Co. USA
    Posts
    242
    The answer to your first question is yes. A session_start() statement must be on every page where you wish to start a new session or re-start an existing session, in order to set or use session variables.

    To allow a visitor to browse between pages and automatically pass values between the pages, you can use - cookies, session variables, or parameters on the end of the URL.

Posting Permissions

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