Hi guyz i am getting an error on my header information..the warnig is displayed
when this part of code Runs
echo '<a href="' . 'ecomm_catalogue_view.php?product_code=' . $product_code .'" >'; '</a>';
header("location: ecomm_catalogue_view.php?' . 'product_code=' . $product_code . '");
the warning displayed on top of each page is:
Warning: Cannot modify header information - headers already sent by (output started at \romajir\search.php:19) in C:\xampp\htdocs\romajir\search.php on line 20
i dont know how to solve this any suggestion would help..thanx in advance
the search code for search.php is
<?php
include 'db.inc.php';
$db = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD) or
die ('Unable to connect. Check your connection parameters.');
mysql_select_db(MYSQL_DB, $db) or die(mysql_error($db));
$search= (isset($_POST['search'])) ? trim($_POST['search']) : '';
if (isset($_POST['submit']) && $_POST['submit'] == 'Go') {
if (empty($search)) {
echo 'Their is Nothing to search!!';
}
else {
$query = 'SELECT product_code FROM ecomm_products WHERE name = "' .
$search . '"';
$result = mysql_query($query, $db) or die(mysql_error());
if (mysql_num_rows($result) > 0){
$row = mysql_fetch_assoc($result);
$product_code=$row['product_code'];
echo '<a href="' . 'ecomm_catalogue_view.php?product_code=' . $product_code .'" >'; '</a>';
header("location: ecomm_catalogue_view.php?' . 'product_code=' . $product_code . '");
}
else{
echo 'We don\'t have that product. Sorry...';
$search = '';
}
}
}
?>