-
if ($_GET['zoni']==$your_value)
-
echo "some text";
-
else echo "other text";
-
I'm not sure i understand where you want to place the if -then statement, but if you want to echo select text depending on whether the value was selected or not you can do it like that:
[HTML]
<form method="get">
<select name="zoni" onchange="showCustomer(this.value)">
<option value="0" selected="selected">[Select]<?php if ($_GET['zoni']=='0') echo "is selected"?></option>
<option value="1">zone А <?php if ($_GET['zoni']=='1') echo "is selected";?></option>
<option value="2">zone B <?php if ($_GET['zoni']=='2') echo "is selected";?></option>
<option value="3">zone C <?php if ($_GET['zoni']=='3') echo "is selected";?></option>
</select>
</form>[/HTML]
If you want to do this more elegant, you should try this:
-
<?php
-
$selectOptions[0]="[Select]";
-
$selectOptions[1]="Zone A";
-
$selectOptions[2]="Zone B";
-
$selectOptions[3]="Zone C";
-
$i=0;
-
?>
-
<select name="zoni" onchange="showCustomer(this.value)">
-
<?php
-
while (isset($selectOptions[$i]))
-
{
-
$text=$selectOptions[$i];
-
if ($_GET['zoni']==$i) $text.=" is selected";
-
echo '
-
<option value="'.$i.'">'.$text.'</option>
-
';
-
$i++;
-
}
-
?>
-
</select>
-
Hope it helps