faqts : Computers : Programming : Languages : PHP : Common Problems : Forms and User Input : URLs and Post or Get Methods

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

4 of 9 people (44%) answered Yes
Recently 4 of 9 people (44%) answered Yes

Entry

How 2 manipulate HTTP_POST_VARS["my_var"] as array if "my_var" is gonna have a lot values (chkbox)?

Jan 27th, 2005 06:12
Philip Olson, Francisco Rosas,


Use an array:
  http://php.net/manual/en/faq.html.php#faq.html.arrays
All values in said array were checked. Give each checkbox a different
value (but same name) and you'll know which were checked.
And consider using $_POST instead of $HTTP_POST_VARS.
  http://php.net/variables.external