Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Global scope 1

Status
Not open for further replies.

ElGuapo

Programmer
Aug 29, 2001
42
0
0
SI
Hi!

I am relatively new with php. I have created a page, where users have to register in order to have access to all the forums.

The server has PHP 4.2 installed and I cannot find a way to store a variable that I could call from different subpages. I would like to store the UserID.

The only way I got it to work was by using cookies, however this is not the prefered way of my boss.

Does anybody know how to register a variable, that could be used in any of the subpages?

Thanks in advance.

Rok
 
you have to use a session variable - this is the only var that "survives" from pages to pages. They can use either cookies or url params (what you want to use !). Basically, the idea is to pass the session_id() with each request.
the doc is here --> scroll down, there's an example using <?=SID?> - scroll even further and in the notes there are also a few example.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top