ok
here is an example.
So my check box WAS <input name="chkBox" type="checkbox" id="chkBox" value="<?php echo $row_Recordset1['description']; ?>" />
I repeated the region, and it listed all my items in my recordset no problem.
When i tick the boxes however, and send to my form, i origionally called a new recordset, and matched the recordset to filter by form variable chkBox = to description. Again, this worked but only with one box ticked. It did not pull in more info if i had two or more boxes ticked.
So... with my google powers, i googled what i was trying to do and it told me to make the checkbox name include square brackets... []
As you can see in this exapmple now, i have renamed chkBox as item[]
<input name="item[]" type="checkbox" id="chkBox" value="<?php echo $row_Recordset1['description']; ?>" />
OK, so in my recieving page, i have this code...
<?php
$quantity = $_POST['quantity'];
$item = $_POST['item'];
foreach ($item as $itemS)
{
echo "You ordered ". $quantity . " " . $itemS . ".<br />";
}
echo "Thank you for ordering from Tizag Art Supplies!";
?>
Now it echos all the items i tick. GREAT.
So i thought ok, lets do the same with the quantity. But of course it doesnt work like that does it. So how do i make the quanitity box relative to the records, and echo on my other page??? It just doesnt work. I tried this
<?php
$quantity = $_POST['quantity'];
$item = $_POST['item'];
foreach ($item as $itemS)
foreach ($quantity as $quantityS)
{
echo "You ordered ". $quantityS . " " . $itemS . ".<br />";
}
echo "Thank you for ordering from Tizag Art Supplies!";
?>
But all that does is repeat the recordset 10times and puts the value in the column that it was typed in.
THe OVERALL goal was to not have a tick box at all, just a value box, where you entered a number and it then took that as selected bringing it across to the processor.php, but i cant even figure out how to bring a number across even WITH the tick box so i have no hope.
Not being very bright with PHP without dreamweaver guiding me... i tried a "while" statement...
<?php
$quantity = $_POST['quantity'];
$item = $_POST['item'];
foreach ($item as $itemS)
foreach ($quantity as $quantityS)
while ($quantityS > 1)
{
echo "You ordered ". $quantityS . " " . $itemS . ".<br />";
}
echo "Thank you for ordering from Tizag Art Supplies!";
?>
This seems to do what i want it to do.... just it pulled it in to processor.php an infinate number of times over and over and over.................
Richard Williams
p.s. Please remember to rate our post replies and tick if solved. Also, please remember that we here are NOT employed by Adobe, we do this out of love and fun, so its always nice to recieve a Please and Thank You! :o)