Re: Re: php NEWBIE get image warning
| From: | daniel at rhesusb dot dk | Date: | Fri, 23 May 2003 08:49:35 +0000 |
| Subject: | Re: Re: php NEWBIE get image warning | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-148741@lists.php.net to get a copy of this message | ||
This is typically what happens if any kind of HTML has been inserted before your PHP script. That
could be an <HTML> tag, or even just a space before "<?", like:
<? session_start();
^
(that's a space)
or
<HTML>
<? session_start();
Cookies are sent with the header, and therefore any script that uses headers must exist before ANY
other content.
Cheers =)
My system is Redhat Linux 7.2 and PHP version is 4.3.1 .
When I use 'php' to run the php script directly,such as '[root@Servers-4
testsuit]#php ./control.php'.The source code of 'control.php' is following:
<?php
session_start();
if (session_is_registered("statu") && isset($statu))
{
if ($action=="stop")
{
$statu = "PowerOff";
}
elseif($action=="pause")
{
$statu = "Pause";
echo "The service has paused successfully.\r\n";
}elseif($action=="resume")
{
$statu = "PowerOn";
echo "The service is resumed successfully.\r\n";
}else
{
echo "Please input the command line with parameter.\r\n";
}
}
else
{
echo "Session handle not exist!\r\n";
}
?>
And some error messages output.
"Warning: session_start() [http://www.php.net/function.session-start]:
Cannot send session cookie - headers already sent in
/www/servers/testsuit/control.php on line 3
Warning: session_start() [http://www.php.net/function.session-start]: Cannot
send session cache limiter - headers already sent (output started at
/www/servers/testsuit/control.php:3) in /www/servers/testsuit/control.php on
line 3
Session handle not exist!"
Please help me, thanks!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php