how do i make a variable, global to the whole page?
in the following basic code the variable: name, seems to be out of scope from the first (local) script tag. is this right? or am i looking
at this too much from a cpp perspective? help!!
<html>
<head><title>the title!</title></head>
<body>
<?php
$fd=fopen($fullpath,"r"); //assume $fullpath has been init
//set up variable: name
$name=fgets($fd,$max); //could init it using any function..
?>
//more html stuff..
//setting up a table...
<?php
//use the variable: name
echo "{$name}"; //cant seem to access it here?
?>
</body><html>
so if this is the problem, how do i make the variables global to ALL the php script tags? (i.e. global to the page)
i tried the global keyword (obviously!) but it didnt work!
thanks, CK