This is a discussion on How to use $GLOBALS within the alt.comp.lang.php forums, part of the PHP Programming Forums category; If I am understanding the documentation correctly, when you place info into $GLOBALS, it is avaialable anywhere, including on another ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
If I am understanding the documentation correctly, when you place info
into $GLOBALS, it is avaialable anywhere, including on another page. Is this correct? The reason I ask is that I am putting the value of a variable into $GLOBALS, and I can get its value then and there, but when I go to another page, the value that I put into $GLOBALS no longer seems to be in existence. |
|
|||
|
On 13-Jul-2003, reynoldscraigr@hotmail.com wrote: > If I am understanding the documentation correctly, when you place info > into $GLOBALS, it is avaialable anywhere, including on another page. > Is this correct? no it's only available on the page in which it was set. > > The reason I ask is that I am putting the value of a variable into > $GLOBALS, and I can get its value then and there, but when I go to > another page, the value that I put into $GLOBALS no longer seems to be > in existence. saving variables between pages is often done with sessions: http://www.php.net/manual/en/ref.session.php -- Tom Thackrey www.creative-light.com |
|
|||
|
On Sun, 13 Jul 2003 21:56:21 +0800, reynoldscraigr@hotmail.com wrote:
>If I am understanding the documentation correctly, when you place info >into $GLOBALS, it is avaialable anywhere, including on another page. >Is this correct? No. >The reason I ask is that I am putting the value of a variable into >$GLOBALS, and I can get its value then and there, but when I go to >another page, the value that I put into $GLOBALS no longer seems to be >in existence. Sounds like you're thinking of sessions. -- Andy Hassall (andy@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk) Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space) |
|
|||
|
On Sun, 13 Jul 2003 21:56:21 +0800, reynoldscraigr@hotmail.com wrote:
>If I am understanding the documentation correctly, when you place info >into $GLOBALS, it is avaialable anywhere, including on another page. >Is this correct? > >The reason I ask is that I am putting the value of a variable into >$GLOBALS, and I can get its value then and there, but when I go to >another page, the value that I put into $GLOBALS no longer seems to be >in existence. OK, thanks everyone for putting me on the right track. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|