RE: [PHP] Re: Checking for empty values sent from a form[Scanned]
| From: | Michael Egan | Date: | Thu, 06 Mar 2003 14:40:45 +0000 |
| Subject: | RE: [PHP] Re: Checking for empty values sent from a form[Scanned] | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-138470@lists.php.net to get a copy of this message | ||
Have you tried echoing out the $query just to ensure that all the expected values are being passed
to this?
If the old_email field is blank I think it will carry out the update but no rows will be affected.
Michael
-----Original Message-----
From: Leendert [mailto:goat@daholygoat.com]
Sent: 06 March 2003 14:24
To: php-general@lists.php.net
Subject: Re: [PHP] Re: Checking for empty values sent from a
form[Scanned]
You usually don't want spaces either
foreach($_POST as $val)
{
if(strlen(trim($val)) < 1)
// do what you want
}
"Rick Emery" <remery@emeryloftus.com> wrote in message
news:003f01c2e3e8$033ef290$0500a8c0@honeybee...
> foreach($HTTP_POST_VARS as $val)
> if($val=="")
> {
> do something
> }
> ----- Original Message -----
> From: "shaun" <shaun@mania.plus.com>
> To: <>
> Sent: Thursday, March 06, 2003 7:45 AM
> Subject: [PHP] Re: Checking for empty values sent from a form
>
>
> 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?
> > >
> > >
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php