i'm trying to set up sessions on a website i've got online but from the start i have not been able to get sessions to work. i thought just to get started i would attempt a simple counter but even this wont work.
this is the php i have tried in a file called index.php:
<?php
// initialize a session
session_start();
// register a session variable
session_register('counter');
// increment and display the value of the counter
$counter++;
echo("You have visited this page $counter times!");
?>
when i open the page in my browser at:
http://www.habitrecordings.co.uk/index.php
i get the following message:
Notice: Undefined variable: counter in d:\websites\habi322219\www\index.php on line 9
You have visited this page 1 times!
each time i reload the page this message stays the same.
the permissions on my server are set to run php, i know this because i have a php guestbook that runs perfectly well. could someone please tell me what the problem is, i've tried a number of other simple scripts and nothing works at all. HELP !!!
Thankyou.
By the way my site is hosted on a Dell Windows 2000 server