I have been having a problem that seems to originate in a Hit Counter block that I wrote myself, but has no obvious cause.
On every page that has the hit counter, you get a blank page when you submit a form, such as a search or login. In the error log, I get a 'Cannot modify header information - headers already sent' error. I have checked ALL my files for whitespace after the closing php tags, if any.
When I disable the hit counter, everything is fine. The Hit Counter's code is simply:
----------
echo('<center>');
system('/web/convextech/counter/counter.cgi convextech');
echo('</center>');
----------
I have only put in the ending php tag so that this forum displays the code properly. Where it is entered in the block module, it has no ending php tag.
I have also set the Input Format for this block to PHP Code.
Could anyone help? My site is at http://convextech.homelinux.org/
Comments
Problem fixed
Well, I've fixed the problem on my own. I should have worked harder before posting.
And for anyone else who has this problem: you need to store the output and then echo it, or the system function is executed before the rest of the Drupal scripts. Use
instead of what I earlier posted.