220061
Well-Known Coder
I'm not seeing what I'm doing wrong. so basically what I want is that users click the button and then the $row['name'] will be posted to another page. but for some reason I just can't get it to work?? can someone help me ?
this is the other page I want to show the naam from the first page ? what is going wrong?
PHP:
<?php
$sql = "SELECT * FROM huizen";
$stmt = $conn->prepare($sql);
$stmt->execute();
$result = $stmt->get_result();
while ($row = mysqli_fetch_assoc($result)) {
echo '
<div class="product">
<form action="../reservation.php" method="POST">
<h3 class="productname" id="naam" name="naam">'.$row['naam'].'</h3>
<img src="../'.$row['img_dir'].'" alt="huis" style="width: 100%; height: 50%;">
<p>'.$row['beschrijving'].'</p>
<p class="price">'.$row['price'].'</p>
<button class="addtocart" name="bestellen">Bestellen</button>
</form>
</div>';
}
?>
this is the other page I want to show the naam from the first page ? what is going wrong?
Code:
<h2>Reserveren <?php $_POST['naam'];?>