Re: retrieving form checkbox values
| From: | Marek Kilimajer | Date: | Thu, 17 Jul 2003 09:57:43 +0000 |
| Subject: | Re: retrieving form checkbox values | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-155578@lists.php.net to get a copy of this message | ||
This is not necessary, you can do
foreach($_POST['File'] as $file) {
// ...
}
George Pitcher wrote:
Here's my register globals off version: Make sure that your form send a post with the highest index value [howmany]. $howmany=$_POST['howmany']; for ($index = 1; $index < $howmany; $index++){ $checkbox = 'checkbox'.$index; $checkbox= $_POST[$checkbox]; ... Repeat for your other row-level form inputs ... Do something with the data... } Hope this helps George in Oxford-----Original Message----- From: Sævar Öfjörð [mailto:ofjord@simnet.is] Sent: 17 July 2003 10:35 am To: php-general@lists.php.net Subject: RE: [PHP] retrieving form checkbox values I think you have to do <input type=checkbox name=File[]> Then $File becomes an array. If you want to retrieve the value for each checkbox you can use a for loop and do value=$File[$i] -----Original Message----- From: Jason Wong [mailto:php-general@gremlins.biz] Sent: 17. júlí 2003 08:58 To: php-general@lists.php.net Subject: Re: [PHP] retrieving form checkbox values On Thursday 17 July 2003 16:45, caspar kennerdale wrote:I have a form which I want to post multiple values from one functiontoanother using checkboxes. Having one value is simple- the form submits the value $File and isthenretrieved in the target function via $_Request['File'] So far so good. Now I want to have multiple values for $File, because $File is a value assigned to a dynamically generated list of files in a folder (whichwillchange from folder to folder). If I have multiple <input type=checkbox name=File value=$File> thenonlythe last value is posted to the next function and retrieved by $_Request['File'] How can I post and retrieve all values of $File or am I going aboutthisthe wrong way?manual > PHP and HTML Or search the archives and/or ask google. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * ------------------------------------------ Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general ------------------------------------------ /* My doctor told me to stop having intimate dinners for four. Unless there are three other people. -- Orson Welles */ -- 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