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" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
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
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to