Alles uit een while in POST zetten
Per veld lukt wel maar nu all regel en velden in de post zetten.
Ik heb dit.
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?
print '<form action="'.$_SERVER['PHP_SELF'].'" name="order" METHOD="POST">';
while($winkel = mysql_fetch_assoc($result)) {
print '<input type="hidden" name="price_update" value="'.$price.'">';
print '<table width="100%">';
print '<tr><td width="48%" align="left"><input type="hidden" name="id" value="'.$winkel['id'].'"><input type="hidden" name="'.$winkel['product'].'" value="'.$winkel['product'].'">'.$winkel['product'].'</td>';
print '<td width="7%" align="left"><input type="text" name="aantal" value="'.$winkel['aantal'].'" size="1"></td>';
print '<td width="15%" align="left">€ '.$price_totaal.'</td>';
print '<td width="15%" align="left"></td>';
print '<td width="15%" align="left"></td></tr>';
print '</table></form>';
}
print '<input type="submit" name="besteling" value="Bestellen"></form>';
?>
print '<form action="'.$_SERVER['PHP_SELF'].'" name="order" METHOD="POST">';
while($winkel = mysql_fetch_assoc($result)) {
print '<input type="hidden" name="price_update" value="'.$price.'">';
print '<table width="100%">';
print '<tr><td width="48%" align="left"><input type="hidden" name="id" value="'.$winkel['id'].'"><input type="hidden" name="'.$winkel['product'].'" value="'.$winkel['product'].'">'.$winkel['product'].'</td>';
print '<td width="7%" align="left"><input type="text" name="aantal" value="'.$winkel['aantal'].'" size="1"></td>';
print '<td width="15%" align="left">€ '.$price_totaal.'</td>';
print '<td width="15%" align="left"></td>';
print '<td width="15%" align="left"></td></tr>';
print '</table></form>';
}
print '<input type="submit" name="besteling" value="Bestellen"></form>';
?>
Is daar een oplosing voor.
Bij voor baat dank.
ik snap je probleem niet echt...geef wat meer uitleg ;)
<input ..... name="veldnaam[record_id]" .....
uit sql database in post komen.
Code (php)
1
2
3
4
5
6
7
2
3
4
5
6
7
<?
while($winkel = mysql_fetch_assoc($result)) {
print '<input type="hidden" name="winkel['product']" value="winkel['product']">';
?>
while($winkel = mysql_fetch_assoc($result)) {
print '<input type="hidden" name="winkel['product']" value="winkel['product']">';
?>
Dat is geen probleem maar nu moet ik het nog opvangen.
Als het meerder producten zijn hoe vang ik dat op ook met while of anders.
Ik dank jullie voor deze snelle reactie.
Gewijzigd op 23/01/2011 10:44:24 door Adriaan Biesheuvel