Hi.. I am in trouble again
I am getting the following error when one of the validation checks (empty) is true.
Code:Warning: Invalid argument supplied for foreach() in .......Can anyone possibly help?PHP Code:elseif ($install==step1a){
// Begin Form Error Checking
$errors = array();
// Check for a database password
if(empty($dbpass)){
$errors = 'Please enter a password.';
}
// Check for a database username
if(empty($dbuser)){
$errors = 'Please enter a username.';
}
// Check for a database host
if(empty($host)){
$errors = 'Please enter a host name.';
}
// If form validation went okay and there were no errors, continue.
if (empty($errors)) {
// do something here
} else { // if errors array contains a value
echo "<table align=\"center\"><tr><td>The following error(s) occurred:<br />";
foreach ($errors as $msg) { // Print each error.
echo "* $msg<br />\n";
}
echo '</td></tr></table>';
} // End of if (empty($errors)) IF.






Bookmarks