Beste PHPHulpers,

Ik ben bezig met een schoolproject maar loop tegen het volgende aan.
De bedoeling is als ik bijvoorbeeld bij resultaat 1 het aantal 6 geef dat hij op de updatecart.php pagina moet zeggen product id = 1 aantal = 6.
Het enige wat ik mee krijg is dus hoeveel ik er aanklikt en niet de product id's.


<?php include('etc/db.php'); ?>
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
	<title>Groot Grutter</title>
	<link rel="stylesheet" type="text/css" href="etc/style.css" />
	</head>

	<body>
		<div id="wrapper">
			<div id="header"></div>
			<div id="navigation"><center>Info :: Producten :: Leveranciers :: Winkelwagen :: Contact</center></div>
			<div id="content">
				<h2>Informatie</h2>
			</div>
			<div id="content">
				<table class="tblBorders" width="900px">
					<tr>
						<td width="225"><h2><center>Merk</center></h2></td>
						<td width="225"><h2><center>Naam</center></h2></td>
						<td width="225"><h2><center>Prijs</center></h2></td>
						<td width="225"><h2><center>Aantal</center></h2></td>
					</tr>
					<form method="POST" action="actions/cartupdate.php">
						<?php
						$query = "SELECT * FROM producten"; 				 
						$result = mysql_query($query);
						 while($row = mysql_fetch_assoc($result))
							{
								echo '<tr><td>'.$row['merk'].'</td>';
								echo '<td>'.$row['naam'].'</td>';
								echo '<td>€'.$row['prijs'].'</td>';
								echo '<td><select name="product['.$row['id'].']">';
								 $i = 0;
								while($i <= $row['aantal'])
									{
									echo '<option>'.$i.'</option>';
									$i++;
									}
								echo'</select></td></tr>'; 
							}
						?>
				
					<input type="submit">
					</form>
				</table>
			</div>
		</div>
	</body>
	
</html>




<?php 
foreach($_POST['product'] as $id)
{
echo $id;
}
?>

Reageren