Page 1 of 1

Gobal varible accross pages?

Posted: Mon May 27, 2002 9:22 am
by oz
How do you keep the content of a varible accross web pages in the same site?

I tried the gobal command, but it doesn't seem to work, unless I'm doing it wrong.

gobal $refer;
$refer = $HTTP_REFERER;

then when I try to use $refer from another page it's blank.

Oz

Posted: Mon May 27, 2002 9:40 am
by mikeq
Hi,

When moving between pages it needs to be passed, either in the URL i.e. http://www.example.com/nextpage.php?refer=$refer

or

as a hidden form field.

or

you can use cookies or sessions. There is no magic that make them automatically appear between pages.

But if it is a server variable you are trying to retrieve it should be available on all pages, if you are using the latest version of PHP you need to look at the notes on http://www.php.net as there were changes to the way global variables are handled. If you can't find them, then search these forums for messages on $_POST, $_SERVER etc.

This has been answered many times now :cry:

Mike

Posted: Mon May 27, 2002 9:45 am
by oz
but only once for me :wink:
thanks