procedural/crud_mysql/scripts/util.php
# Returns false if at least one field is empty in super global $_POST variable, true otherwise.
Returns false if at least one field is empty in super global $_POST variable, true otherwise.
Returns false if at least one field is empty in super global $_POST variable true otherwise .
function checkEmptyFields($fieldNames)
{
	global $error_msgs;
	$res = true;
	foreach ($fieldNames as $field)
	{
		if (! isset($_POST[$field])) continue;
		$value = format_input($_POST[$field]);
		if (empty($value))
		{
			$error_msgs[$field] = "This field cannot be empty.";
			$res = false;
		}
	}
	return $res;
}
function checkEmptyFields ( $ fieldNames ) { global $ error_msgs ; $ res = true ; foreach ( $ fieldNames as $ field ) { if ( ! isset ( $ _POST [ $ field ] ) ) continue ; $ value = format_input ( $ _POST [ $ field ] ) ; if ( empty ( $ value ) ) { $ error_msgs [ $ field ] = " This field cannot be empty. " ; $ res = false ; } } return $ res ; }
Returns false if at least one field is empty in super global $_POST variable, true otherwise.
Returns false if at least one field is empty in super global $_POST variable true otherwise .