Hi Everyone,
My Name is Robert and I am new to this forum.
I need some help with retrieving data from forms.
At the moment I have a PHP loop which outputs a list of custom DATA from a database.
The loop looks like:
<div class="event-price-table">
<div class="event-price-header">
<span class="col1">Ticket Type</span>
<span class="col2">Ticket Price</span>
<span class="col3">Quantity</span>
</div>
<?php
$myEvent = get_group('Ticket');
$row = 0;
foreach($myEvent as $event) {
$row++;
?>
<div class="event-price-body" id="r-<?php echo $row; ?>">
<span class="col1">
<?php echo $event['ticket_type'][1]; ?>
</span>
<span class="col2"><?php echo $event['ticket_price'][1]; ?></span>
<span class="col3">
<select name="no-of-tickets">
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5 </option>
</select>
</span>
</div>
<?php } ?>
</div>
</div>
The resulting output image is attached.
<img src="http://www.robertfyffe.com/wp-content/themes/rfyffe/uploads/Picture-1.png" />
So the user then will select a ticket type by choosing a quantity and then click submit. This will then bring them to a new page where the user will fill out a form with persona details etc.
What is the best way to get the ticket type and quantity data from the above form?
I have tried $_GET but all this does is return the last item of the loop no matter what ticket type the user selects a quantity on. So basically I need to tell it which row (Ticket Type) in the table the user has selected.
Really need help with this so can anyone help?
Thanks in advance
Robert Fyffe