Re: Checking for empty values sent from a form
| From: | shaun | Date: | Thu, 06 Mar 2003 13:45:52 +0000 |
| Subject: | Re: Checking for empty values sent from a form | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-138463@lists.php.net to get a copy of this message | ||
thanks for your reply but I was wondering if there was a way to check
through all of the form entries with an easier way that
if ($_POST['your_input_name'] == '' || $_POST['your_input_name'] ==
'' ||
$_POST['your_input_name'] == '' || $_POST['your_input_name'] ==
'' ) //etc
// field is empty
this would be particularly useful for forms with lots of fields...
"Niels Andersen" <haj@zhat.dk> wrote in message
news:20030306133359.36901.qmail@pb1.pair.com...
> Since input from a form are strings, you can check like this:
>
> if ($_POST['your_input_name'] == '')
> // field is empty
>
> "Shaun" <shaun@mania.plus.com> wrote in message
> news:20030306132422.30025.qmail@pb1.pair.com...
> > Is there an easy way to scan through an array of values sent from a form
> to
> > see if any of them are empty?
> >
> >
>
>