The code below works fine on my PHP enabled web site.
On my home computer (wamp installed) I get the error message:-
"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".
What am I doing wrong please and how do I overcome it.
Regards
crusty
------------------------------------- code used ----------------
<?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"]++;
?>