RE: [PHP] Need to maintain the integrity of the checkbox
| From: | Jay Blanchard | Date: | Thu, 29 Jul 2004 15:01:19 +0000 |
| Subject: | RE: [PHP] Need to maintain the integrity of the checkbox | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-192196@lists.php.net to get a copy of this message | ||
[snip]
Example of form:
<input type="checkbox" name="wbc_Money" value="$5000">
<input type="checkbox" name="wbc_Wine" value="$1000">
<input type="checkbox" name="wbc_Golffall" value="$3500">
<input type="checkbox" name="wbc_Golfspring" value="$3500">
So the dollar amounts are the same for three of the four events, but
this is
just a snippet of about 20 items. If I take out the dollar amounts, and
just populate an array with what are now the descriptive names, I can
assign
dollar amounts in the checkout script. Am I on the right track?
[/snip]
Yes you are...each would be available thusly.....(with your names and
current values once the submit button is pressed)
$_POST['wbc_Money']; would be equal to $5000
$_POST['wbc_Wine']; would be equal to $1000
$_POST['wbc_Golffall']; would be equal to $3500
$_POST['wbc_Golfspring']; would be equal to $3500
The $_POST array will be populated for you, you do not need to populate
a seperate array. Try it!