Mr Crime Posted January 23, 2013 Share Posted January 23, 2013 (edited) I have an error on my game its not mccodes. http://infamousmobsters.x10.bz/ When you log in I get an error Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/infamo7/public_html/logged_in.php:14) in /home/infamo7/public_html/logged_in.php on line 16 And I tried to fix it but I can :( Help me out? <? include "config.php"; include "func.ban.php"; checkban($_SERVER['REMOTE_ADDR']); session_start(); include_once "includes/db_connect.php"; include_once "includes/functions.php"; logincheck(); ?> <html> <head> <link rel="shortcut icon" href="favicon.ico.png"> <title>InfamousMobsters</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link rel=stylesheet href=includes/in.css type=text/css> </head> <frameset rows="*" cols="168,*" frameborder="no" border="0" framespacing="0"> <frame src="menu.php" name="leftFrame" scrolling="auto" noresize="noresize" id="leftFrame" title="leftFrame"> <? if($info->bann == "0"){ ?> <frameset rows="68,*" cols="*" framespacing="0" frameborder="no" border="0"> <frame src="banner.php" name="banner" scrolling="No" noresize="noresize" id="topFrame" title="topFrame"> <? } ?> <frameset rows="24,*" cols="*" framespacing="0" frameborder="NO" border="0"> <frame src="mini.php" name="topFrame" scrolling="NO" noresize > <frameset rows="*" cols="*<? if($info->box == "0"){ ?>,180<? } ?>" frameborder="no" border="0" framespacing="0"> <frame src="story.php" name="middle" id="mainFrame" title="mainFrame"> <? if($info->box == "0"){ ?> <frame src="/chat/index.php" name="shoutbox" scrolling="auto" noresize="noresize" id="shoutbox" title="shoutbox"> <? } ?> </frameset> </frameset> </frameset> </frameset> <noframes><body></frameset> </body></noframes> </html> Edit: Fixed it abit Edited January 23, 2013 by Mr Crime Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted January 23, 2013 Share Posted January 23, 2013 Try moving your session_start () to line 2 right under your php open tag Quote Link to comment Share on other sites More sharing options...
Mr Crime Posted January 23, 2013 Author Share Posted January 23, 2013 (edited) Yes I figured it yesterday :D Thank you very much kyle! I have another problem :/ Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/infamo7/public_html/mini.php:61) <style type="text/css"> div#wrapper { position: center; float: center; text-align: center; } div#wrapper > div.normal { float: center; margin-right: 10px; background-color: #000000; height: 100px; padding: 3px; } body { background: url('includes/grad.jpg') repeat-x top; margin-left: 100px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; font-family: Tahoma; font-size: 10px; color: #FFFFFF; } .text {font-size: 10px; color: #FFFFFF} a:link, a:hover, a:visited, a:active { text-decoration: none; font-weight: bold; color: #FFFFFF; } </style> <?php session_start(); include "includes/db_connect.php"; include "includes/functions1.php"; logincheck(); $username=$_SESSION['username']; if($info->dashb == "0"){ die(); } ?> <html> <head> <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ setInterval(updateStats, 40000); updateStats(); }); function loadRest(){ $("#Stats").fadeOut(500, function (){ $("#Stats").load("mini_ajax.php", null, function (){ $("#Stats").fadeIn(500); }); }); } function updateStats(){ $.ajax({ type: "GET", url: "notice_ajax.php", success: function(msg){ if(msg != ""){ $("#Stats").fadeOut(500, function (){ $("#Stats").html(msg); $("#Stats").fadeIn(500, function (){ timeout=setTimeout(loadRest, 1500); }); }); }else{ $("#Stats").load("mini_ajax.php"); }}}); } </script> <style type="text/css"> div#wrapper { position: center; float: center; text-align: center; } div#wrapper > div.normal { float: center; margin-right: 10px; background-color: #000000; height: 100px; padding: 3px; } body { background: url('includes/grad.jpg') repeat-x top; margin-left: 100px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; font-family: Tahoma; font-size: 10px; color: #FFFFFF; } .text {font-size: 10px; color: #FFFFFF} a:link, a:hover, a:visited, a:active { text-decoration: none; font-weight: bold; color: #FFFFFF; } </style> </head> <body> <div id="Stats">Loading...</div> </body> </html> fixed it :D <style type="text/css"> div#wrapper { position: center; float: center; text-align: center; } div#wrapper > div.normal { float: center; margin-right: 10px; background-color: #000000; height: 100px; padding: 3px; } body { background: url('includes/grad.jpg') repeat-x top; margin-left: 100px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; font-family: Tahoma; font-size: 10px; color: #FFFFFF; } .text {font-size: 10px; color: #FFFFFF} a:link, a:hover, a:visited, a:active { text-decoration: none; font-weight: bold; color: #FFFFFF; } </style> <html> <head> <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ setInterval(updateStats, 40000); updateStats(); }); function loadRest(){ $("#Stats").fadeOut(500, function (){ $("#Stats").load("mini_ajax.php", null, function (){ $("#Stats").fadeIn(500); }); }); } function updateStats(){ $.ajax({ type: "GET", url: "notice_ajax.php", success: function(msg){ if(msg != ""){ $("#Stats").fadeOut(500, function (){ $("#Stats").html(msg); $("#Stats").fadeIn(500, function (){ timeout=setTimeout(loadRest, 1500); }); }); }else{ $("#Stats").load("mini_ajax.php"); }}}); } </script> <style type="text/css"> div#wrapper { position: center; float: center; text-align: center; } div#wrapper > div.normal { float: center; margin-right: 10px; background-color: #000000; height: 100px; padding: 3px; } body { background: url('includes/grad.jpg') repeat-x top; margin-left: 100px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; font-family: Tahoma; font-size: 10px; color: #FFFFFF; } .text {font-size: 10px; color: #FFFFFF} a:link, a:hover, a:visited, a:active { text-decoration: none; font-weight: bold; color: #FFFFFF; } </style> </head> <body> <div id="Stats">Loading...</div> </body> </html> Edited January 23, 2013 by Mr Crime Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted January 23, 2013 Share Posted January 23, 2013 you cant have session_start() after any browser output Quote Link to comment Share on other sites More sharing options...
a_bertrand Posted January 23, 2013 Share Posted January 23, 2013 Well, not totally true, it depends on your php.ini settings. You can set that PHP buffers the output per default, and then you can start the session, set cookies wherever you want in your page. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.