So I have a form with a couple of list form items that I need to allow the user to be able to select more than one item from. The data I then concactanate into one list of items that gets inserted into a mySQL database and echoed in a results page to the user.
With the following code I can get it to pull all the items from the form and echo it immediately (if I un comment out the echo lines) but I can't get it to all stay in a variable for later use.
I'd could really use some advice. =)
Here's a snippet of the HTML form page:
<select name="appsstand[]" size="4" multiple class="normal">
and
<select name="appsopt[]" size="4" multiple class="normal">
Here's from the PHP page:
$app1=count($appsstand);
for ($i=0; $i<$app1; $i++) {
// echo $appsstand[$i];
$a1 = $appsstand[$i];
}
$app2=count($appsopt);
for ($i=0; $i<$app2; $i++) {
// echo $appsopt[$i];
$a2 = $appsopt[$i];
}
//$apps1 = $_POST['appsstand'];
//$apps3 = "$appsopt";
$apps3 = "$othapps";
$apps = $a1 . " " . $a2 . " " . $apps3;
The various comments and whatnot are remnants from my playing around and experimenting with different attempts at this.
Again, what I'm trying to do is get $apps to contain all the items selected from the form lists for later echoing and insertion into a SQL command.
Thanks!!
Liam
druid -at- celticbear -dot- com