Right, just recently I've started getting error messages at the top of my pages going on about not being able to send headers and whatnot.
"Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/chobe1/public_html/scotland.php:1) in /home/chobe1/public_html/base.php on line 1"
They only show up when my client adds text onto the page and I assumed he must of edited something extra by accident but I checked and everything is the same and I can't work out why it's happening, I don't think he wants a massive error message above the majority of his pages.
All I know that could be causing it is that he is editing it in notepad and I'm editing mine in dreamweaver, normally I wouldn't point something silly like that but it's the only difference, if anyone wants to try to help let me know and I'll link you to the pages. so you can see for your self.
Is that file scotland.php? Because that is the file that the error is being flagged on. Everything looks fine to me in that code so it must be another file causing the problem
<?php include \"base.php\"; ?> <!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=utf-8\" /> <title>Stranded UK: Events</title> <link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\" />
</head> <body> <div class=\"banner\"></div>
<?php include(\"nav.html\"); ?>
<div class=\"background\">
<div class=\"gallerybox\"><div class=\"eventsfilling\"><h1 align=\"left\">?Stranded UK: Leicester 5th March?</h1><div class=\"itemtext\"><img src=\"images/newevent.jpg\" style=\" float:left; display: block; margin-right: 15px; width: 172px; height: 244px;\" /><p> STRANDED LEICESTER returns for the LAST time before summer! This is one event you will not want to miss out on!! For the first time ever STRANDED LEICESTER will be meeting with 2 other cities for the wildest bar crawl ever! <p>? Stranded T-shirt</p> <p>? FREE shot in every venue!</p> <p>? Drinks prizes on the coach!<p> <p>? RETURN travel to a mystery city!</p> <p>? FREE entrance into ALL bars and clubs!</p> <p>? Games and goodies throughout the night!</p> <p>? 100's of students from all over the country in one big super club!</p>
<p>By clicking the buy now button you are agreeing to are <a href=\"tc.php\">terms and conditions</a>.</p> <form action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\"> <input type=\"hidden\" name=\"cmd\" value=\"_s-xclick\"> <input type=\"hidden\" name=\"hosted_button_id\" value=\"6RRVXJYWZSURN\"> <table> <tr><td><input type=\"hidden\" name=\"on0\" value=\"Sizes\">Sizes</td></tr><tr><td><select name=\"os0\"> <option value=\"Small\">Small £25.00</option> <option value=\"Medium\">Medium £25.00</option> <option value=\"Large\">Large £25.00</option> </select> </td></tr> </table> <input type=\"hidden\" name=\"currency_code\" value=\"GBP\"> <input type=\"image\" src=\"https://www.paypal.com/en_US/GB/i/btn/btn_buynowCC_LG.gif\" border=\"0\" name=\"submit\" alt=\"PayPal - The safer, easier way to pay online.\"> <img alt=\"\" border=\"0\" src=\"https://www.paypal.com/en_GB/i/scr/pixel.gif\" width=\"1\" height=\"1\"> </form>
<?php
} else { ?>
<b>Purchases can be made without a Stranded account, however if you do wish to make an account in order to save time for future purchases please <a href=\"login.php\">click here.</a><p><p> If you do not wish to make an account and just wish to purchase a shirt please click the button below to continue to checkout.</b> <p><button style=\" background-color: #141414; border: 1px solid #0b0b0b; color: #4a4a4a; padding:5px; font-family:'tahoma';\" onClick=\"window.location='itemLeic1_tempshop.php'\">Purchase</button></p>
The only thing I can think of is that there is a gap between where the file actually starts and where the code starts e.g. You've accidentally hit return before typing the code. This whitespace could cause the error.
I'm going to assume you are on Windows. So you will need to open the file in a binary editor, namely VIM http://www.vim.org/download.php
It will either be in the main file or the PHP file that you included and will be on the first line. Just delete the extra characters and save the file. I have not used VIM before though so am not sure how it works
"Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/chobe1/public_html/scotland.php:1) in /home/chobe1/public_html/base.php on line 1"
They only show up when my client adds text onto the page and I assumed he must of edited something extra by accident but I checked and everything is the same and I can't work out why it's happening, I don't think he wants a massive error message above the majority of his pages.
All I know that could be causing it is that he is editing it in notepad and I'm editing mine in dreamweaver, normally I wouldn't point something silly like that but it's the only difference, if anyone wants to try to help let me know and I'll link you to the pages. so you can see for your self.
I can have a look for you if you have the sample code causing the error
the page the sesion is in is
Don't ask me why it's like that, my friend did it a while back and I've had no problems until the last week.
and on the pages it shows up on the include is before everything on line 1.
http://stranded-uk.com/itemLeic1.php
The actually displayed page:
The base file from earlier:
The navagation bar, no php but it's connected through an include:
and I believe that's it, it's probably something silly I missed because I'm not to strong with php but still.
The error you are getting basically means that session_start() is not the first line of content outputted to the browser.
It sounds like this is your problem and solution so give it a go
http://kasolutions.wordpress.com/2009/0 ... eady-sent/
It will either be in the main file or the PHP file that you included and will be on the first line. Just delete the extra characters and save the file. I have not used VIM before though so am not sure how it works