Posted on: 08/23/04 08:56am
By: Anonymous (tokyoahead)
Hi,
I am writing a small php-script that is packed into a static page.
I want to set a new variable in that script that is used in all functions of that script during the users time to use the script. So when a user clicks on a link on the page that calls the static page again with another parameter, that variable should be retained, just like session-variables do.
I tried it but it did not work.
for testing I wrote a simple script:
if (!isset($_SESSION['var']))
{$var=1;}
else
{$var=$_SESSION['var'];}
$var++;
$_SESSION['var']=$var;
echo $var;
It shows that the session-set variable is deleted (unregistered) with every click.
Any idea how to do it?
thanks
Session variables in Static pages?
Posted on: 08/23/04 09:45am
By: Blaine
Are you trying to use the new CVS code or GL 1.3.9 ?
GL does not currently use PHP Sessions but we have added support for them in the new CVS code (1.3.10).
If not - you can modify GL to use Sessions but you likely are not starting SESSIONS - you will need to explore how to use Sessions.
Session variables in Static pages?
Posted on: 08/23/04 10:06am
By: Anonymous (tokyoahead)
Thanks for answering so fast.
I was making an error to forget the session_start();
I tried to start it from within a function but this never worked.
Now I added it on the first line of the static page code and it worked!
thanks