0

I can modify header with status server 404 () header('HTTP/1.0 404 Not Found'); from inside php/html document in php 5.5 in php 5.3 I can't. Is there some solution in php 5.3?

for example:

<div>
//select product from db
// if false 
header('HTTP/1.0 404 Not Found')
</div>

This page returns 404 not found and this is called from html/php code: http://hairone.eu/1-3-1-2-0-0-334546-ruske-ludske-vlasy-cop-c-rki4.html code is here

 <div>
 <?php

      @$sub_pages_id = MySql_Query("SELECT id FROM ".$sub_table." WHERE id = '".$sub_id."' AND view='1'");
      @$sub_pages_id = MySql_Result($sub_pages_id, 0);



  if(!$sub_pages_id):
    header('HTTP/1.0 404 Not Found');      
    echo $status_in_404;  
  endif;

?>
</div> 
apredsa
  • 11
  • 2
  • 1
    You can't send headers out after you have sent you have output. That's true in *any* version. – John Conde Jun 14 '15 at 14:03
  • This page returns 404 not found and this is called from html/php code http://hairone.eu/1-3-1-2-0-0-334546-ruske-ludske-vlasy-cop-c-rki4.html – apredsa Jun 14 '15 at 14:11

0 Answers0