I try to make linke and when I click to that link I want to get some data from database in new page (details.php
) but when I try to do this the (details.php
)page it open empty without anything!!
the link code is:
<a href='details.php?pro_id=$pro_id' sytle='float:left;'>Details</a>
and the php code in details.php page is:
<?php
if(isset($_Get['pro_id'])){
$Product_id= $_Get['pro_id'];
$get_pro= "select * from products where Product_id = '$Product_id'";
$run_pro= mysqli_query($con, $get_pro);
while($row_pro= mysqli_fetch_array($run_pro)){
$pro_id=$row_pro['Product_id'];
$pro_title=$row_pro['Product_title'];
$pro_price=$row_pro['Product_price'];
$pro_image=$row_pro['Product_image'];
$pro_desc=$row_pro['Product_desc'];
echo "
<div id='single_product'>
<h3>$pro_title</h3>
<img src='admin_area/product_images/$pro_image' width='400px' height='300px' />
<p><b> Price $pro_price RO</b></p>
<a href='index.php?pro_id=$pro_id' sytle='float:left;'>Go Back</a>
<a href='index.php?pro_id=$pro_id'><button style='float:right';>Add to Cart</button></a>
</div>
";
}
}
?>
Ican not find where is my mistake