Re: empty variables from a form
| From: | Kevin Stone | Date: | Wed, 05 Feb 2003 19:21:05 +0000 |
| Subject: | Re: empty variables from a form | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-134468@lists.php.net to get a copy of this message | ||
Next time please consider searching on PHP.net or Google before you post.
This is an exceedingly basic question and there is an extraordinary amount
of information already out there..
if(empty($_POST['ac2']))
{
echo "Area Code is a required field.";
}
-Kevin
----- Original Message -----
From: "Sunfire" <rusty_81@msn.com>
To: <php-general@lists.php.net>
Sent: Wednesday, February 05, 2003 11:49 AM
Subject: [PHP] empty variables from a form
> hi..
>
> how would you test for an empty (unused) variable from a form..
> i have a phone number split into 3 different vairiables and want to test
to
> see if they were used in the form before displaying either the phone
number
> itself or just leaving it out of the display... what code would be good to
> test it with.. the variables are $ac2 $ext2 and $num2
>
>
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.443 / Virus Database: 248 - Release Date: 1/10/2003
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>