Jule wrote:
> Hey,
> i'm just wondering if there is another way to write global variables to a 
> global.php, now i just the whole fopen etc script, where i open a file and 
> write the sctring $number_right = [whatever number it is] to the file, but is 
> there a different way to write it to the file with one simple command?
> 
> i could use cookies, but i prefer a simpler way.
> 
> thanks
> 
> Jule

At want point did you stop and think that it would be *easier* to write 
information to a file?  You could use cookies and should use cookies if 
your looking for a simpler way, sessions as well.

If you don't mind information not being around the next time the user 
returns (after closing his/her browser) you could write to the always 
global always available $_SESSION array. For example 
$_SESSION['foo']="bar"; and $_SESSION['bar']="foo";  It's not writing to 
a file, but is one simple command and the information you store will 
follow them anywhere within your site.

If you want save the information you could just as easily use $_COOKIES. 
  But would require that you use the setcookie command.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to