开发者

Warning regarding sesion_start [duplicate]

This question already has answers here: Closed 11 years ago.

Possible Duplicate:

php headers already sent error

I've this warning. How can I开发者_如何学Python fix it?

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\AppServ\www\PhpProject1\login.php:2) in C:\AppServ\www\PhpProject1\controller\login.controller.php on line 2

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\AppServ\www\PhpProject1\login.php:2) in C:\AppServ\www\PhpProject1\controller\login.controller.php on line 2


paste session_start(); in the first line


You should also be aware that saving your files in the wrong encoding can produce this error.

http://forums.iis.net/t/1171412.aspx


Session needs to be started before ANY content is printed out. You're echoing something earlier or simply printing something outside PHP tags.

Move your session_start before those print outs. This concerns print outs from ALL your files. It says you even where you've printed stuff out.

output started at C:\AppServ\www\PhpProject1\login.php:2

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜