Page 1 of 1

global variable

Posted: Thu Dec 18, 2003 2:13 am
by StyM
hello and good day.

i have a variable declared inside a php file.
in one of html page, i set the variable some values before going to the next page, when i arrive to my next page the variable is empty. why????

how can i make a variable accessible to any page without lossing its value being set.?????


thanks so much for the help..

Posted: Thu Dec 18, 2003 2:15 am
by m3mn0n
Add the variable within a file and [php_man]include[/php_man]() or [php_man]require[/php_man]() it within all the pages.

Or use cookies, see [php_man]setcookie[/php_man]() in the manual for more information. [php_man]Sessions[/php_man] are also another option.

Posted: Thu Dec 18, 2003 4:53 am
by Nay
But, if it was in HTML, if he did not add the <?php and ?> it will not be parsed. Just hope he has the <?php echo $the_var ?> or so.

-Nay