x-raven Posted April 29, 2009 Share Posted April 29, 2009 Hey so I'm new here and kind of a newbie at php, i've been tinkering with it for a year now but never really got in depth with it until very recently. I am working on an admin/backend area for a project of mine for some friends and im having some issues. So my my session was working just fine earlier and now I am implementing a design and it is now giving me an error.. ERROR: Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\xampp\htdocs\exotic\main.php: in C:\xampp\htdocs\exotic\main.php on line 36 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-9" /> <title>Exotic Island Real Estate Management Panel</title> <link href="style.css" rel="stylesheet" type="text/css" /> <script src="js/jquery-1.js" type="text/javascript"></script> <script type="text/javascript" charset="utf-8"> //tabbed forms box $(function () { var tabContainers = $('div#forms > div.innerContent'); // change div#forms to your new div id (example:div#pages) if you want to use tabs on another page or div. tabContainers.hide().filter(':first').show(); $('ul.switcherTabs a').click(function () { tabContainers.hide(); tabContainers.filter(this.hash).show(); $('ul.switcherTabs li').removeClass('selected'); $(this).parent().addClass('selected'); return false; }).filter(':first').click(); }); </script> </head> <?php /** * Exotic Island Real Estate SIM/Parcel Management * * @author Original by Randy Cram (Raven Beamish) <http://logicdepths.net/> * @version 1.0a * @file main.php */ session_start(); if(!$_SESSION['username']) { ?> ERROR <?php } else { ?> LOGGED IN <?php } ?> Its not like the login isn't working, cause i get the message saying "LOGGED IN" which i only have to get this part working first and i get more content but i dont know why this error is there. please help. Quote Link to comment Share on other sites More sharing options...
gffg4574fghsDSGDGKJYM Posted April 29, 2009 Share Posted April 29, 2009 the session_start() function in php use cookie and need to use the header() function. Always put it at start before anything else (even space or enter) like this : <?php session_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-9" /> <title>Exotic Island Real Estate Management Panel</title> ... Quote Link to comment Share on other sites More sharing options...
x-raven Posted April 29, 2009 Author Share Posted April 29, 2009 Thank you that worked. Quote Link to comment Share on other sites More sharing options...
gffg4574fghsDSGDGKJYM Posted April 29, 2009 Share Posted April 29, 2009 You're welcome 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.