Hello all
I have an online form doing server side validation with PHP.
However, when I select a U.S. State, it says that this state is not in the U.S.
Like, Sorry, Arkansas is not in the U.S., or Vancouver is not in Canada.
Can someone tell me why I have this code problem?
The following is the validation code:
if($HTTP_POST_VARS['Country'] == "United States"){
if(in_array($HTTP_POST_VARS['State'],$state['usa'])){
$error['color'][5] = FIELD_LABEL;
$error['value'][5] = $HTTP_POST_VARS['State'];
}else{
$error['message'] = $HTTP_POST_VARS['State']." is not in ".$HTTP_POST_VARS['Country']."<br> Please enter the proper State/Province and Country marked in <font color=\"".ERROR_COLOR."\">BLUE</font> below:";
$error['color'][5] = ERROR_COLOR;
$error['value'][5] = $HTTP_POST_VARS['State'];
}
Someone please help me and let me know why I am having this problem
Thanks
🙂