The Arcive of vBulletin Modifications Site. |
|
|
#1
|
||||
|
||||
|
I know how to work with regular forms. Even drop downs. But not when it comes to multiple selections.
In my case, I have 8 check boxes with the name "sizes[]" with different values. When a user checks 1 or more boxes, I want that information to pass on to the next page to get sent in an email. Here's the block of coding I'm using. Code:
<?php
$email = $_SESSION['MM_UserEmail'];
$username = $_SESSION['MM_Username'];
$userid = $_SESSION['MM_UserID'];
$instructions = $_POST['instructions'];
for ($x = 0; $x < count($sizes); $x++)
{
$papersize = "$sizes[$x]";
}
$message = "$username (userid $userid) wants \"$paper paper\" and the following sizes:\n\n
$papersize
has sent the following instructions:\n\n\"$instructions\".";
$from = $email;
$to = "some@email.com";
$subject = "$username (userid $userid) Uploaded Photographs";
$headers = "From: $from";
mail($to,$subject,$message,$headers);
$sizes is the name of the 8 check boxes with different sizes. Code:
for ($x = 0; $x < count($sizes); $x++)
{
$papersize = "$sizes[$x]";
}
Andrew, I tried putting $papersize = "$sizes . $x"; but that didn't work. ![]() I ran into this code which looked simpler but didn't work either. Code:
foreach($sizes as $value)
{
$papersize = "$value ";
}
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|