Re: [PHP] Ckeckbox list populated from database

2009-09-20 Thread tedd

At 9:06 PM -0700 9/19/09, Haig Davis wrote:

Hello List,

I'm relatively new to PHP although I do feel I've got a grasp of the 
basics. I have used php to draw up numerous selection lists 
populated from a mysql database and have had no trouble at all.


However when it comes to the same concept yet using HTML check boxes 
I aM complety stumped. It seems easy but I've been staring at the 
same problem for hours.


Any hints are greatly appreciated.

Thanks

Haig

Sent from my iPhone


Haig:

This might help:

http://php1.net/b/form-checkbox
http://php1.net/b/form-checkbox1

Cheers,

tedd

PS: I wish I had an iPhone.

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] Ckeckbox list populated from database

2009-09-20 Thread saeed ahmed
you can do that
here is the example,

 >

--
Regards,
Saeed Ahmed
Rajshahi, Bangladesh
Blog: http://saeed05.wordpress.com
--
Follow Me Linkedin
Twitter


Re: [PHP] Ckeckbox list populated from database

2009-09-19 Thread Paul M Foster
On Sat, Sep 19, 2009 at 09:06:14PM -0700, Haig Davis wrote:

> Hello List,
>
> I'm relatively new to PHP although I do feel I've got a grasp of the
> basics. I have used php to draw up numerous selection lists populated
> from a mysql database and have had no trouble at all.
>
> However when it comes to the same concept yet using HTML check boxes I
> aM complety stumped. It seems easy but I've been staring at the same
> problem for hours.
>
> Any hints are greatly appreciated.

I don't know what type of field you're trying to use to populate the
checkbox, but it basically comes down to this:

/>

or

/>

You've got to decide what is "checked" and "unchecked" for your
checkbox, and then make that a condition which triggers a "checked" or
"unchecked" state for the box. If you like, you can also put a
value="something" attribute in the input tag as well.

When your user is finished inputting the form and you go to process the
results, you can check for the existence of the checkbox name in the
$_POST variable, or check that the $_POST variable contains the value
you set in the value="something" attribute.

Checkboxes and radio buttons are tricky in this way, because they don't
normally return values in the same way an  field
does.

Paul

-- 
Paul M. Foster

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



[PHP] Ckeckbox list populated from database

2009-09-19 Thread Haig Davis

Hello List,

I'm relatively new to PHP although I do feel I've got a grasp of the  
basics. I have used php to draw up numerous selection lists populated  
from a mysql database and have had no trouble at all.


However when it comes to the same concept yet using HTML check boxes I  
aM complety stumped. It seems easy but I've been staring at the same  
problem for hours.


Any hints are greatly appreciated.

Thanks

Haig

Sent from my iPhone

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