Warning: Cannot modify header information - headers already sent by (output started at /home2/insat/public_html/search1.php:5) in /home2/insat/public_html/search1.php on line 36
The code goes like this:
[PHP]<html>
<title>CMS:Sear ch Product</title>
<body>
<?php //line 5
include "dbconnect.php" ;
// The basic SELECT statement
$select = 'SELECT DISTINCT pcode,purl ';
$from = ' FROM product';
$where = ' WHERE 1=1 ';
$searchtext = $_POST['searchtext'];
if($searchtext != "")
{
$searchtext = mysql_real_esca pe_string($sear chtext) ;
$where .= " AND pcode = '$searchtext'";
}
?>
// execute the query
<?php
$url = mysql_query($se lect . $from . $where);
// test the result
if (!$url)
{
exit('<p>Error retrieving urls from database!<br />'.
'Error: ' . mysql_error() . '</p>');
echo '<p> no product found</p>' ;
}
while ($lcurl = mysql_fetch_arr ay($url))
{
$id = $lcurl['pcode'];
$pdurl = htmlspecialchar s($lcurl['purl']);
header("Locatio n:$pdurl"); // line 36
}
?>
</body>
</html>[/PHP]
------------------------------------------------------------
please help.