PHP Warnings when edited

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I am struggling to understand why I have warning raised by the CMS
(WordPress) when I take the fully working function below:

=== code ===
function comments_rss_link($link_text='Comments RSS', $commentsrssfilename =
'wp-commentsrss2.php') {
        $url = comments_rss($commentsrssfilename);
        echo "<a href='$url'>$link_text</a>";
=== /code ===

and simply add rel='nofollow' to the link. Once changed, I look at the
resulting source, which indicates that the function generated the desired
code. However, PHP raises the following type of errors: (triggered by many
different functions)

=== code ===
PHP Warning:  Cannot modify header information - headers already sent by
(output started at
in /home/schestow/public_html/Weblog/wp-rss.php
=== /code ===

I have been having similar problems for almost a year. In fact, whenever I
change PHP files I appear to break something. Even more strangely, changing
the code back to its old state wouldn't do. I need to upload the original
file -- that is -- before it ever got edited in order to stop the warnings.
Any ideas as to why?

Thanks in advance,


Re: PHP Warnings when edited

Roy Schestowitz wrote:
Quoted text here. Click to load it
Quoted text here. Click to load it

Without seeing all of your code I'd guess it's because you've got a
rogue space outside your PHP code (in template-functions-comment.php)
and you're trying to set a header later in wp-rss.php.

How are you editing the file?  Perhaps your text editor is saving in
some alien format.


Re: PHP Warnings when edited

Using a pointed stick and pebbles, scraped:

Quoted text here. Click to load it

That would be my guess too. Roy: Have you accidentally created a newline
at the end of the template-functions-comment.php after the closing "?>" ?

Dylan Parry -- Where the Music Progressively Rocks!

Re: PHP Warnings when edited

__/ [Dylan Parry] on Thursday 01 September 2005 09:20 \__

Quoted text here. Click to load it

Yes. *smile* That must be it, though I haven't tested it yet. The editor
that is build onto cPanel has been doing it for quite some time (I noticed
it before because I use it almost exclusively).

I imagined that the PHP interpreter, much like in any other programming
languages, would ignored the excess. I will give it a go and tell you if
the problem is still unresolved. I doubt so.

Many thanks,


Roy S. Schestowitz      | Useless fact: Women blink twice as much as men  |    SuSE Linux    |     PGP-Key: 74572E8E
  8:30am  up 8 days  1:12,  3 users,  load average: 0.51, 0.57, 0.58

Site Timeline