is there any reason why this will not work?
i get the following error
HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-Strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<form id="form1" method="post" action="default.php">
<div>
<?php
// initialize a session
session_start();
// increment a session counter
$_SESSION['counter']++;
// print value
echo "You have viewed this page " . $_SESSION['counter'] . " times";
?>
</div>
</form>
</body>
</html>
i get the following error
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/myweb/public_html/sessions.php:12) in /home/myweb/public_html/sessions.php on line 14
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/myweb/public_html/sessions.php:12) in /home/myweb/public_html/sessions.php on line 14
You have viewed this page 1 times