Posted by Hilarion on 08/23/05 19:07
adam <adam@graphicsdesign.org> wrote:
> haven't tested it yet, but it seemed a bit overdone for what it does.
> suggestions on how to simplify it a bit greatly appreciated :]
>
> [snip]
Try this (uncomment line with $requirementMet if you need that):
function checkData( $requiredFields )
{
$error = array_diff_key( $requiredFields, $_POST );
//$requirementMet = array_keys( array_intersect_key( $_POST, $requiredFields ) );
if (count($error))
{
error( $error );
exit;
}
else
submitData();
}
Hilarion
Navigation:
[Reply to this message]
|