To check if a type checkbox variable has been set use
isset() i.e.

if (
       isset($interest)
    or isset($interest2)
    or isset($interest3)
    or isset($interest4)
    or isset($interest1)
   )
{
// Everthing is ok
} else {

   $error = .....

)

This should do exactly what you want, and although it may
not use the least characters
it should be the quickest to write/debug/maintain and run. 

Regards,

George 



Richard Kurth wrote:
> 
>  I have 5 checkbox's in a form that I what to make sure at least one of
>  the checkbox is checked.
> 
> <input type='checkbox' name='interest' value='basic'>
> <input type='checkbox' name='interest3' value='Internet access '>
> <input type='checkbox' name='interest1' value='pro'>
> <input type='checkbox' name='interest4' value='domain name'>
> <input type='checkbox' name='interest2' value='platinum'>
> 
>   I am checking for blank field buy doing this below How can I check for at
>   least one of the above check boxes is checked
> 
> if ($name == "") {
>       $name_err = "
>        <font color=red>Please enter your name!</font><br> ";
> 
>                 $send = "no";
> 
>         }
> 
> Best regards,
>  Richard
> mailto:[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to