If a heckbox is left blank, then the webserver does not pass it's name/value
pair on to the PHP processor.

This means that if you have
<input type=checkbox name=foo>
And the box is not checked, then when your script recieves the form,
$_POST['foo'] will not be available.

So to test for it, use isset($_POST['foo']) to see if they checked it.

(the example code is for version 4.1.x)


[TK] 

> -----Original Message-----
> From: Daniel Ferreira Castro [mailto:[EMAIL PROTECTED]] 
> Sent: Tuesday, 19 March 2002 1:27 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Getting values of Checkboxes
> 
> 
> I have checkboxes on my FORM and I want to get the values of 
> thoses checkboxes with my PHP script. My html use the post 
> method I am trying to use 
> $HTTP_POST_FORM['name_of_the_checkbox'] but I am not beeing 
> successfull. How can I do it??
> 
> Thank you
> 
> Daniel; F. Castro
> 
> 
> 
> 
> 
> -- 
> 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