I’m having trouble error checking my webform by using the empty() function. Below is an example of what I’m trying to accomplish.
[php]
$rx = array();
for ($x = 0; $x < 8; $x++) {
$rx[$x] = $_POST[“rx$x”];
}
if (empty($rx)) {
echo “ERROR”;
}
else {
echo “SUCCESS”;
}
[/php]
The array is populated by a series of textboxes in the form.
[php]
1. Rx Number:
2. Rx Number:
3. Rx Number:
[/php]
The array is working, it is being populated with the info I enter in the form, yet there seems to be a problem with my if statement, since it reports SUCCESS when I don’t enter any information in the rx textboxes.
Any ideas?