I'm trying to add header("HTTP/1.1 404 Not Found");
to the following PHP so that pages without any products show as Not Found.
if(@$usecsslayout) print '<div class="' . $cs . 'products">';
$totrows=ect_num_rows($allprods);
if(ect_num_rows($allprods)==0)
print (! @$usecsslayout ? '<tr><td colspan="' . $productcolumns . '" align="center">' : '') . '<p>'.$GLOBALS['xxNoPrds'].'</p>' . (! @$usecsslayout ? '</td></tr>' : '');
else while($rs=ect_fetch_assoc($allprods)){
I have added header("HTTP/1.1 404 Not Found");
in various places after if(ect_num_rows($allprods)==0)
and the file hangs.
If I replace the print element (print (! @$usecsslayout ? '<tr><td colspan="' . $productcolumns . '" align="center">' : '') . '<p>'.$GLOBALS['xxNoPrds'].'</p>' . (! @$usecsslayout ? '</td></tr>' : '');)
with header("HTTP/1.1 404 Not Found");
then a Not Found is generated.
My problem is that I want a Not Found combined with the print statement.