session的问题!!!
我写了个简单的程序测试session,程序如下:
<html>
<title>无标题文档</title>
<body>
<?php
Session_start();
Session_register("mycount");
$mycount++;
echo "$mycount";
?>
</body>
</html>
错误如下:
Warning: session_start(): Cannot send session cookie - headers already sent by (output started at C:\Inetpub\wwwroot\2.php:4) in C:\Inetpub\wwwroot\2.php on line 5
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at C:\Inetpub\wwwroot\2.php:4) in C:\Inetpub\wwwroot\2.php on line 5
Notice: Undefined variable: mycount in C:\Inetpub\wwwroot\2.php on line 7
sdff 1
Warning: Unknown(): Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in Unknown on line 0
请高手指点啊!!!