Riiight, I think this is what you're getting at:
PHP Code:
<?php
//Form an array of descriptions for each field
$desc['FN'] = 'first name';
$desc['LN'] = 'last name';
//Your thing again
foreach($_POST as $key => $val) {
if (empty($val)) {
$error_msg = "$desc[$key] must be filled in.\n";
$errors = true;
?>
Disclaimer. (1) Whilst I will help you sometimes, if I feel like it, and my advice in relation to your actual question will be of good quality: my posts are to be taken with a pinch of salt. I will be sarcastic, deploy irony and include obscure cultural references for my own amusement without warning.
(2) You will gain nothing from complaining, and if you try to argue with me then you will not win. No matter how noble your battle seems, I am still better than you, don't be an hero.
Bookmarks