HOME       >>       Programming

Changes


khalilov

I just got hosted and i am everything is working fine, but i got this in one of the pages:

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/khalilov/public_html/economy.php:4) in /home/khalilov/public_html/topview.php on line 9

I am used include inside a php file, the file i included had session_start() and so did the main file i used include in, is that a problem? if not whats the reason of this error?

toby

Put all session_ and cookie_ stuff before any html or blank lines. If this doesn't make sense, it's only ten lines so just post them for our help.


khalilov

<html><link type="text/css" href="look.css" /><b><?phpsession_start();

i change it to
<?php session_start();?><html><link type="text/css" href="look.css" /><b><?php

and it gave
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/khalilov/public_html/economy.php:4) in /home/khalilov/public_html/topview.php on line 1

note that i used session_start() when the player logs in, and i put it in the begining of every php scrip, perhaps thats the issue?
I doubt it though cuz everytime i remove the session_start nothinh shows since i use $_SESSION['..'] to get info, so iam guessing its needed so that you can keep reading variables stored on login

pyost

Well... Take a look at economy.php, line 4 - that's where the problem is


Eggie

yeah...you should check economy.php for that error since it says

output started at /home/khalilov/public_html/economy.php:4

khalilov

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/khalilov/public_html/militarytrain.php:5) in /home/khalilov/public_html/militarytrain.php on line 7

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/khalilov/public_html/economy.php:4) in /home/khalilov/public_html/topview.php on line 9

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/khalilov/public_html/economybuildings.php:4) in /home/khalilov/public_html/topview.php on line 9

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/khalilov/public_html/workers.php:5) in /home/khalilov/public_html/topview.php on line 9

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/khalilov/public_html/militarytrain.php:5) in /home/khalilov/public_html/militarytrain.php on line 7

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/khalilov/public_html/militaryresearch.php:5) in /home/khalilov/public_html/militaryresearch.php on line 7

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/khalilov/public_html/armies.php:5) in /home/khalilov/public_html/armies.php on line 7

Its happening everywhere O.o, all pages have include('topview,php'), in top view i use sessionstart, and then i also use it at the lines showing in error ,could that be the problem?

economy.php
<html><link type="text/css" href="look.css" /><body><?phpinclude('topview.php');include('leftmenu.php');include('economystatus.php');?></body></html>

Iam lost =(

toby

Anything involving, including asking for in includes, anything to do with sessions, cookies, headers, redirects ALL need to be before any html or white space.


khalilov

Thx its working now =), i thought you were only refering the topview script but you meant all other scripts that had topview included.thx =)



VIEW ORIGINAL REGISTER GET FREE HOSTING

Xisto.com offers Free Web Hosting to its Members for their participation in this Community. We moderate all content posted here but we cannot warrant full correctness of all content. While using this site, you agree to have read and accepted our terms of use, cookie and privacy policy. Copyright 2001-2019 by Xisto Corporation. All Rights Reserved.