i have a little problem while getting a value from database and post it to another page , heres my code . on search.php the user enter the price min and price max , then on page result.php it shows from database the name and price of the product and a link for more infos .(info.php) this 3rd page will show some additional informations based on the Id of the product shown on result.php i tried to hide the value of Id_product from result and post it to 3rd form but doesnt work.i got an error Notice: Undefined index: id in info.php line 4
//////search.php /////
<form method="post" action="result.php" >
<tr> <INPUT type=text size=20 name=pricemin ><BR> </tr>
<tr> <INPUT type=text size=20 name=pricemax ><BR> </tr>
<tr> <input type="submit" class="Nom" id="button" value="Valider" /></tr></form>
///////result.php //////
<?php include 'includes/connection.php';
$pricemin = $_POST['pricemin'];
$pricemax = $_POST['pricemax'];
$query = "SELECT * FROM product where price between '$pricemin' and '$pricemax'";
$result = mysql_query($query);?>
<?php if(mysql_num_rows($result) > 0)
while($products = mysql_fetch_array($result)) {?>
<?php echo $products['name_product'] ;echo $products['price_product'] ;
echo "<a href='http://localhost/mywebsite/info.php'>More infos</a>"
?>
<form method="post" action="info.php" >
<input type="hidden" name="id" value="<?php echo $products['id_product']; ?>" />
</form><?php } ?>...
///// info.php //////
<?php
include 'includes/connection.php';
$id_product = $_POST['id'];
$query = "SELECT * FROM product where id_product='$id_product'";
$result = mysql_query($query); ?>
<html><head><title>.. </title></head><body>
<?php
while($products = mysql_fetch_array($result)) {?>
<h1>Product ID : <?php echo $products['id_product'] ; ?> </h1>
<h1>Product name : <?php echo $products['name_product'] ; ?> </h1>
<h1>Product Qt : <?php echo $products['quantity_product'] ; ?> </h1>
<h1>Product Spec : <?php echo $products['spec_product'] ; ?> </h1>
<?php } ?></body></html>