Global Variable

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
desmondlk
Forum Commoner
Posts: 27
Joined: Tue Sep 24, 2002 10:27 pm
Location: Malaysia

Global Variable

Post by desmondlk »

Dear all,

How can define a variable as global in order for to pass it from page to page?

With this global variable, i can access it in each page that i visit.

If the hosting site already disable global variable (register_global),
how can i fix it in order to fit into my problem?

Please help. Thank in advance.
User avatar
deejay
Forum Contributor
Posts: 201
Joined: Wed Jan 22, 2003 3:33 am
Location: Cornwall

Post by deejay »

i think what your after is SESSIONS if your looking to carry values from page to page. take a look at this thread

viewtopic.php?t=6521
bionicdonkey
Forum Contributor
Posts: 132
Joined: Fri Jan 31, 2003 2:28 am
Location: Sydney, Australia
Contact:

Post by bionicdonkey »

you could also send the variable with the url e.g. index.php?var=value
then use $_GET['var'] to get the variable on the next page...but sessions would be better if the variable is for the whole site
Post Reply