Newbie so this is probably a daft question.
I've tried the following which works on my PHP enabled web site.
If I try it on my home machine (WAMP Installed) I get the error.
"Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at c:\wamp\www\Mesh4Us\Htdocs\AlecHall\session1.php:2) in c:\wamp\www\Mesh4Us\Htdocs\AlecHall\session1.php on line 3"
Is there a way around this please.
Thanks. Crusty.
<?php
session_start();
if ($SESSION["last_visit"]) { echo "Date of last visit: ";
echo date("j F Y, H:i:s", $SESSION["last_visit"]); echo "<br>"; echo "Total visits: ".$SESSION["num_visits"];
} else
echo "This is your first visit";
$SESSION["last_visit"] = time();
$_SESSION["num_visits"]++;
?>