<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>Tech-Recipes - Latest Comments in Solve PHP error: Cannot modify header information - headers already sent | PHP programming | Tech-Recipes</title><link>http://tech-recipes.disqus.com/</link><description>Cookbook of Tech Tutorials</description><language>en</language><lastBuildDate>Thu, 02 Jul 2009 16:43:25 -0000</lastBuildDate><item><title>Re: Solve PHP error: Cannot modify header information - headers already sent | PHP programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/1489/solve-php-error-cannot-modify-header-information-headers-already-sent/#comment-12046143</link><description>I am not getting this error on my local PC, but when I upload the scripts to the hosting provide I get this error. How can I set my local machine to display the same error&lt;br&gt;&lt;br&gt;Cheers</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Charlies</dc:creator><pubDate>Thu, 02 Jul 2009 16:43:25 -0000</pubDate></item><item><title>Re: Solve PHP error: Cannot modify header information - headers already sent | PHP programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/1489/solve-php-error-cannot-modify-header-information-headers-already-sent/#comment-11850322</link><description>Thanks a lot, after reading and carefully looking through the codes paying attention to your advice theproblem was resolved.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Emmanuel Afonrinwo</dc:creator><pubDate>Sun, 28 Jun 2009 08:40:32 -0000</pubDate></item><item><title>Re: Solve PHP error: Cannot modify header information - headers already sent | PHP programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/1489/solve-php-error-cannot-modify-header-information-headers-already-sent/#comment-11497766</link><description>Make sure there is no white space outside of the php start and end tags&lt;br&gt;&lt;br&gt;This is really a culprit.&lt;br&gt;Thanks for help.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">dinesh</dc:creator><pubDate>Sat, 20 Jun 2009 07:41:04 -0000</pubDate></item><item><title>Re: Solve PHP error: Cannot modify header information - headers already sent | PHP programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/1489/solve-php-error-cannot-modify-header-information-headers-already-sent/#comment-11450819</link><description>I had an include with two blank lines after the ?&amp;gt; in that include... I deleted those blank lines and It works perfectly!&lt;br&gt;&lt;br&gt;Thanks!</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Leandro</dc:creator><pubDate>Fri, 19 Jun 2009 11:07:28 -0000</pubDate></item><item><title>Re: Solve PHP error: Cannot modify header information - headers already sent | PHP programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/1489/solve-php-error-cannot-modify-header-information-headers-already-sent/#comment-10758178</link><description>Ugh. Of course!! My problem was, as you said, hiding in plain site. I was echoing a file upload verification right before calling header(), and I didn't even notice it. &lt;br&gt;&lt;br&gt;Thanks for the easy instructions!</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jamie</dc:creator><pubDate>Thu, 11 Jun 2009 15:47:56 -0000</pubDate></item><item><title>Re: Solve PHP error: Cannot modify header information - headers already sent | PHP programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/1489/solve-php-error-cannot-modify-header-information-headers-already-sent/#comment-10729269</link><description>That really great....thanx.....sooo mch....</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Mithus</dc:creator><pubDate>Thu, 11 Jun 2009 00:59:14 -0000</pubDate></item><item><title>Re: Solve PHP error: Cannot modify header information - headers already sent | PHP programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/1489/solve-php-error-cannot-modify-header-information-headers-already-sent/#comment-10556205</link><description>That was fun..... whitespace really where a problem... thanks</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">neoniflor</dc:creator><pubDate>Fri, 05 Jun 2009 23:19:12 -0000</pubDate></item><item><title>Re: Solve PHP error: Cannot modify header information - headers already sent | PHP programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/1489/solve-php-error-cannot-modify-header-information-headers-already-sent/#comment-10478467</link><description>UTF-8 should work fine on any OS. It's the BOM (Byte Order Mark) that causes the problem, but since UTF-8 always has the same byte order it doesn't need a BOM. See &lt;a href="http://unicode.org/faq/utf_bom.html#bom5" rel="nofollow"&gt;http://unicode.org/faq/utf_bom.html#bom5&lt;/a&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Thu, 04 Jun 2009 05:49:02 -0000</pubDate></item><item><title>Re: Solve PHP error: Cannot modify header information - headers already sent | PHP programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/1489/solve-php-error-cannot-modify-header-information-headers-already-sent/#comment-10108217</link><description>Uh, yeah, that's nice, but....&lt;br&gt;&lt;br&gt;what if you need your PHP file to be UTF8 because you need non-ANSI characters in your script defined strings?&lt;br&gt;&lt;br&gt;My UTF8 .php file works fine on Windows 5.2.5, but barfs on a linux build of same version.&lt;br&gt;&lt;br&gt;Sigh.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">mark</dc:creator><pubDate>Wed, 27 May 2009 18:56:38 -0000</pubDate></item><item><title>Re: Solve PHP error: Cannot modify header information - headers already sent | PHP programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/1489/solve-php-error-cannot-modify-header-information-headers-already-sent/#comment-9469117</link><description>Legendary stuff... this article just saved my sanity. A white space after the close php tag in an 'include' file caused my hours of frustration.&lt;br&gt;&lt;br&gt;Thank you!</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Andy</dc:creator><pubDate>Sun, 17 May 2009 07:59:36 -0000</pubDate></item><item><title>Re: Solve PHP error: Cannot modify header information - headers already sent | PHP programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/1489/solve-php-error-cannot-modify-header-information-headers-already-sent/#comment-9323159</link><description>thnks.........&lt;br&gt;i have been working on the same for the past 5 days........... the error i had was a space before PHP tag..</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">bapo333</dc:creator><pubDate>Thu, 14 May 2009 08:14:32 -0000</pubDate></item><item><title>Re: Solve PHP error: Cannot modify header information - headers already sent | PHP programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/1489/solve-php-error-cannot-modify-header-information-headers-already-sent/#comment-9131327</link><description>U DA MAN... Removing DOM fixed it...</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">thejimgaudet</dc:creator><pubDate>Fri, 08 May 2009 12:07:00 -0000</pubDate></item><item><title>Re: Solve PHP error: Cannot modify header information - headers already sent | PHP programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/1489/solve-php-error-cannot-modify-header-information-headers-already-sent/#comment-8768164</link><description>this error will be thrown if u have any  white spaces or any print or echo above header call. &lt;br&gt;There should be no print , no echo and no spaces before or after header statement.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">IMQ</dc:creator><pubDate>Tue, 28 Apr 2009 04:07:00 -0000</pubDate></item><item><title>Re: Solve PHP error: Cannot modify header information - headers already sent | PHP programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/1489/solve-php-error-cannot-modify-header-information-headers-already-sent/#comment-8768021</link><description>Warning: Cannot modify header information - headers already sent by (output started at /home/misaghi/public_html/config.php:47) in /home/misaghi/public_html/login_process.php on line 79</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Lito</dc:creator><pubDate>Tue, 28 Apr 2009 03:52:25 -0000</pubDate></item><item><title>Re: Solve PHP error: Cannot modify header information - headers already sent | PHP programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/1489/solve-php-error-cannot-modify-header-information-headers-already-sent/#comment-8622119</link><description>how can modify display_error in php script ?</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">manuel</dc:creator><pubDate>Thu, 23 Apr 2009 18:14:27 -0000</pubDate></item><item><title>Re: Solve PHP error: Cannot modify header information - headers already sent | PHP programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/1489/solve-php-error-cannot-modify-header-information-headers-already-sent/#comment-7337695</link><description>Thanks! It works now :)))</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">MetalGarurumon</dc:creator><pubDate>Thu, 19 Mar 2009 04:55:16 -0000</pubDate></item><item><title>Re: Solve PHP error: Cannot modify header information - headers already sent | PHP programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/1489/solve-php-error-cannot-modify-header-information-headers-already-sent/#comment-7250284</link><description>This did it!  THANKS SO MUCH!!  Nothing else worked and I tried it all!</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">RORO</dc:creator><pubDate>Mon, 16 Mar 2009 03:41:36 -0000</pubDate></item><item><title>Re: Solve PHP error: Cannot modify header information - headers already sent | PHP programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/1489/solve-php-error-cannot-modify-header-information-headers-already-sent/#comment-6653896</link><description>Actually, there are some solution, problem is well documented on link:&lt;br&gt;&lt;a href="http://php.net/manual/en/function.header.php" rel="nofollow"&gt;http://php.net/manual/en/function.header.php&lt;/a&gt;&lt;br&gt;&lt;br&gt;It is related to earlier versions of PHP, or to setup in php.ini&lt;br&gt;I've put on the very first line:&lt;br&gt;&amp;lt;?php&lt;br&gt;ob_start();&lt;br&gt;session_start();&lt;br&gt;?&amp;gt;&lt;br&gt;Now, everything works fine, i-e you can have more than one header in your code.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Fr</dc:creator><pubDate>Thu, 26 Feb 2009 08:33:05 -0000</pubDate></item><item><title>Re: Solve PHP error: Cannot modify header information - headers already sent | PHP programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/1489/solve-php-error-cannot-modify-header-information-headers-already-sent/#comment-6653384</link><description>This helped me to some my problem. Where i was trying to generate a xml file using php.&lt;br&gt;&lt;br&gt;Thanks</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">dominic</dc:creator><pubDate>Thu, 26 Feb 2009 07:55:59 -0000</pubDate></item><item><title>Re: Solve PHP error: Cannot modify header information - headers already sent | PHP programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/1489/solve-php-error-cannot-modify-header-information-headers-already-sent/#comment-6616243</link><description>wwwwwwwwwwwwwoooooow thanks sir problem solved,, stupid white space</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">dave</dc:creator><pubDate>Wed, 25 Feb 2009 12:49:29 -0000</pubDate></item><item><title>Re: Solve PHP error: Cannot modify header information - headers already sent | PHP programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/1489/solve-php-error-cannot-modify-header-information-headers-already-sent/#comment-6407256</link><description>Your database query may not be returning a valid result. It's good practice to make sure the result returned from your mysql_query command is valid..  something like:&lt;br&gt;&lt;br&gt;if (!$result) {&lt;br&gt;    die('Invalid query: ' . mysql_error());&lt;br&gt;}&lt;br&gt;&lt;br&gt;Dumping the error message may help in this case, too.&lt;br&gt;&lt;br&gt;Good luck!</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">qmchenry</dc:creator><pubDate>Thu, 19 Feb 2009 13:15:34 -0000</pubDate></item><item><title>Re: Solve PHP error: Cannot modify header information - headers already sent | PHP programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/1489/solve-php-error-cannot-modify-header-information-headers-already-sent/#comment-6404721</link><description>hi&lt;br&gt;please help me.. please please please.&lt;br&gt;please take a look at the following script:&lt;br&gt;it is giving the following errors&lt;br&gt;---------------------------------------------------------------------------------------&lt;br&gt;Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/compkcom/public_html/cmpanel/check_login.php on line 11&lt;br&gt;&lt;br&gt;Warning: Cannot modify header information - headers already sent by (output started at /home/compkcom/public_html/cmpanel/check_login.php:11) in /home/compkcom/public_html/cmpanel/check_login.php on line 19&lt;br&gt;---------------------------------------------------------------------------------------&lt;br&gt;here goes the  php script&lt;br&gt;----------------------------------------------------------------------------------------------------&lt;br&gt;&amp;lt;?php session_start();&lt;br&gt;if((isset($_POST['username'])&amp;&amp;$_POST['username']!="")&amp;&amp;(isset($_POST['password'])&amp;&amp;$_POST['password']!="")){&lt;br&gt;$error='';	&lt;br&gt;$conn = mysql_connect('localhost','compkcom_care','ptk')or die('Could not connect to MySQL database. ' . mysql_error());&lt;br&gt;mysql_select_db(SQL_DB,$conn);&lt;br&gt;$query = "SELECT COUNT(username) AS record FROM admin WHERE username ='" . $_POST['username']."' AND password = '".$_POST['password']."'";&lt;br&gt;$result = mysql_query($query);&lt;br&gt;$row = mysql_fetch_array($result);&lt;br&gt;if($row['record']==1){&lt;br&gt;$_SESSION['user_logged'] = $_POST['username'];&lt;br&gt;$_SESSION['user_password'] = $_POST['password'];&lt;br&gt;header("location:welcome.php");&lt;br&gt;}&lt;br&gt;else{&lt;br&gt;$error .="Please+Enter+Correct+Username+and+password%21%0D%0A";&lt;br&gt;header("location:index.php?&amp;error=".$error);&lt;br&gt;}&lt;br&gt;}&lt;br&gt;else{&lt;br&gt;$error .="Please+Enter+the+Username+and+password+First%21%0D%0A";&lt;br&gt;header("location:index.php?&amp;error=".$error);&lt;br&gt;}&lt;br&gt;?&amp;gt;:&lt;br&gt;----------------------------------------------------------------------------------------------------&lt;br&gt;this script is running fine on my local windows server but giving the above mentioned errors on my linux hosted server..&lt;br&gt;Please help me...&lt;br&gt;Thanks..</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Sachin </dc:creator><pubDate>Thu, 19 Feb 2009 11:36:19 -0000</pubDate></item><item><title>Re: Solve PHP error: Cannot modify header information - headers already sent | PHP programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/1489/solve-php-error-cannot-modify-header-information-headers-already-sent/#comment-6043199</link><description>It did work! Colour me amazed! Ta!</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dan</dc:creator><pubDate>Fri, 06 Feb 2009 10:04:22 -0000</pubDate></item><item><title>Re: Solve PHP error: Cannot modify header information - headers already sent | PHP programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/1489/solve-php-error-cannot-modify-header-information-headers-already-sent/#comment-5808944</link><description>Thanks, helped me a lot.&lt;br&gt;Amazing what some additional unnoticed whitespace can cause havoc&lt;br&gt;sometimes.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Klaus</dc:creator><pubDate>Tue, 03 Feb 2009 10:43:00 -0000</pubDate></item><item><title>Re: Solve PHP error: Cannot modify header information - headers already sent | PHP programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/1489/solve-php-error-cannot-modify-header-information-headers-already-sent/#comment-5805030</link><description>Strange issue, I've removed header completely from html, actually, completely &amp;lt;html&amp;gt; tags, and only with&lt;br&gt; &amp;lt;?php &lt;br&gt;......&lt;br&gt;header("location:../first.php");&lt;br&gt;?&amp;gt;&lt;br&gt;then it is working properly.&lt;br&gt;I've got a line with echo before the header, and got the same warning - Cannot modify header information - headers already sent.&lt;br&gt;This is happening on a linux environment, on windows (+Apache+mysql) I've got no such a messages, well, I didn't compared those two php.ini  properly. &lt;br&gt;Anyway, thanks for help.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Fr</dc:creator><pubDate>Tue, 03 Feb 2009 06:21:39 -0000</pubDate></item></channel></rss>