Hallo,
function check_form() {
foreach ($_POST as $key => $value) {
if (trim($value) == "") {
$GLOBALS["form_message"] = "wert $key ist leer";
return false;
}
return true;
}
}
<?php if(!check_form):?>
<p class="form_error">Da lief was falsch:<?=$GLOBALS["form_message"]?></p>
<?php else:?>
<p>alles prima</p>
<?php endif?>
ungetestet.
Gruß
jobo