...

View Full Version : how do I create a check box?



straden
05-04-2004, 04:44 AM
i have a newbie question...
I want to make a checkbox table consisting several attributes
i know how to declare type as "checkbox"
so declaring each of my attributes as "checkbox"
and then when checkbox is marked , how do I put all the check ones into one table?

for example, a user checked photography, movies, sports as true...
how do I make it so that the user has true value for those 3 attributes and false for all the
other unchecked ones?
sorry, im very noob =/

raf
05-04-2004, 08:34 AM
Welcome here !

What do you mean by

and then when checkbox is marked , how do I put all the check ones into one table?

sad69
05-04-2004, 10:28 PM
I think you need to understand what PHP is and where its engine sits in the scheme of things:

The user sees a form, HTML form even, with checkboxes organized in a table. There has to be a submit button somewhere to POST/GET the form to a PHP script file. It is at this point that the PHP script will run.

In your PHP script, you can access the checkbox variables by their name through the post array: $_POST["checkbox_variable_name"]

One thing to note about checkboxes is that if they are not checked, they will not post themselves to the PHP script (ie. they will not exist in $_POST[]).

Check out this link for some more insight:
http://www.onlamp.com/pub/a/php/2003/03/13/php_foundations.html

Hope that helps,
Sadiq.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum