Well $state is a form value.
<tr ALIGN="LEFT" VALIGN="TOP">
<td> <b><FONT color="#<?php echo $error['color'][5];?>">State or Province:</FONT></b><br>
<select NAME="State">
<?php echo gen_state($error['value'][5]);?>
</select></td>
<td><b><FONT color="#<?php echo $error['color'][6];?>">Country:</FONT></b><br>
<select NAME="Country">
<?php echo gen_country($error['value'][6]);?>
</select></td>
</tr>
And...
function gen_state($user_state)
{
$state['usa'][0] = "Alabama";
$state['usa'][1] = "Arkansas";
$state['usa'][2] = "Arizona";
ect......... for each state and province
}
$list_state = "";
$list_state .= "<option value=\"\">Choose a State/Province</option>";
$list_state .= "<option value=\"\">United States</option>";
$j = count($state['usa']);
for($i=0;$i<$j;$i++){
if($user_state == $state['usa'][$i] && $sel != "selected"){
$sel = " selected";
}else{
$sel = "";
}
$list_state .= "<option value=\"".$state['usa'][$i]."\" $sel>..".$state['usa'][$i]."</option>";
}
$list_state .= "<option value=\"\">Canada</option>";
$j = count($state['canada']);
for($i=0;$i<$j;$i++){
if($user_state == $state['canada'][$i] && $sel != "selected"){
$sel = " selected";
}else{
$sel = "";
}
$list_state .= "<option value=\"".$state['canada'][$i]."\" $sel>..".$state['canada'][$i]."</option>";
}
return $list_state;
}
unset($country);
function gen_country($user_country)
{
$country[0] = "United States";
$country[1] = "Canada";
$list_country = "<option value=\"\">Choose a Country</option>";
$j = count($country);
for($i=0;$i<$j;$i++){
if($user_country == $country[$i] && $sel != " selected"){
$sel = " selected";
}else{
$sel = "";
}
$list_country .= "<option value=\"".$country[$i]."\" $sel>".$country[$i]."</option>";
}
return $list_country;
}
Would you now be able to tell me what the problem is?
This is mindbogglin.