Jump to content

[SOLVED] Cannot modify header information - headers already sent by...


HowdeeDoodee

Recommended Posts

Color my face red, no I did not read the sticky. Shame on me.

 

Here is the full error message.

 

Warning: Cannot modify header information - headers already sent by (output started at /home/findt/public_html/CP/searchtest.php:65) in /home/findt/public_html/CP/searchtest.php on line 827

 

   $result = mysql_query($query) or die(mysql_error());
    $num_record = mysql_num_rows($result);
    $sql_num_rows = mysql_num_rows($result); 
    //echo "Number of effected rows: $sql_num_rows";
    if($sql_num_rows < (1))      
    {
echo "      No records were found.      ";
header("location: /CP/errorpage_norecords.htm"); 
    exit; 
    } 

 

Line 827 is the one beginning with "header" shown above.

 

The code is full of comments, so I will clean those out and see what happens. I thought there might be a troubleshooting method but perhaps not.

 

Thank you for the posts.

You are all correct on eliminating the echo statements. I had tons of them and was not aware of the header vs. echo issue. Although now it makes sense since an echo brings up a page. Thank all of you who posted. Freaks rule again!!!!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.