tommynanda,
That is very close, but this test page shows each division that
is seleced the same number of selected divisions.
For instance, if I select Austin and MABL, it shows:
{two options selected}
austin
mabl
austin
mabl
If I select Austin Capitol and LS, it shows:
{three options selected}
austin
capitol
lonestar
austin
capitol
lonestar
austin
capitol
lonestar
How would I keep that from happening?
<?php
$i=0;
$division = $_POST['division'];
foreach($division as $div)
{
if($div=="all")
{
$i = 1;
}
if($i==1)
{
echo "All<br>";
} else
{
foreach($division as $div)
{
switch ($div) {
case "austin":
echo $div."<br>";
break;
case "capitol":
echo $div."<br>";
break;
case "lonestar":
echo $div."<br>";
break;
case "mabl":
echo $div."<br>";
break;
default:
break;
}
$div = '';
}
}
}
?>
<html>
<head>
</head>
<body>
<form name="baseform" action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post">
<select name="division[]" size="5" multiple="true">
<option value="all">All</option>
<option value="austin">Austin</option>
<option value="capitol">CAP</option>
<option value="lonestar">LS</option>
<option value="mabl">MABL</option>
</select>
<input type="submit" name="Submit" value="Build Ticker Files">
</form>
</body>
</html>