Forum Moderators: coopster
So, I wrote program that only starts a session and I can't get session started. Here is the code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 STRICT//EN"
"http://www.w3.org/TR/xhtm11/DTD/xhtm11-strict.dtd">
<html xmlns="http://www.w3org/1999/xhtml" lang="en" xml:lang="en" >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<html>
<head>
<title>2nd</title>
</head>
<body>
<?php session_start();
echo "go figure";?>
</body>
</html>
Here are the results:
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at .../2nd.php:10) in .../2nd.php on line 10
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at .../2nd.php:10) in .../2nd.php on line 10
go figure
As I said, it works on my Windows (PC) server, but gives error on the Linux - Host server.
Anything stick out as a mistake?
Thanks so much!
KP
<?php
session_start();
?>
<!DOCTYPE HTML PUBLIC"-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type"content="text/html;charset=iso-8859-1">
So, is there any reason you wouldn't want to make the very first line of every page start with:
<?php session_start();?> ?
So, is there any reason you wouldn't want to make the very first line of every page start with:
<?php session_start();?> ?