How to use $GLOBALS

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 ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-13-2003
reynoldscraigr@hotmail.com
 
Posts: n/a
Default How to use $GLOBALS

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.
Reply With Quote
  #2 (permalink)  
Old 07-13-2003
Tom Thackrey
 
Posts: n/a
Default Re: How to use $GLOBALS


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
Reply With Quote
  #3 (permalink)  
Old 07-13-2003
Andy Hassall
 
Posts: n/a
Default Re: How to use $GLOBALS

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)
Reply With Quote
  #4 (permalink)  
Old 07-14-2003
reynoldscraigr@hotmail.com
 
Posts: n/a
Default Re: How to use $GLOBALS

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.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:58 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0