note 502 modified in Variables from outside PHP by ronabop

From: Date: Sat, 10 Mar 2001 23:54:25 +0000
Subject: note 502 modified in Variables from outside PHP by ronabop
Groups: php.notes 
Request: Send a blank email to php-notes+get-12254@lists.php.net to get a copy of this message
The "checkbox" input type, by definition, is designed to return multiple values, so when writing a form with checkboxes that will get submitted to a PHP script, you need to use the varname[] syntax in the form. An example: <form method="post" action="foo.php3"> <input type="checkbox" name="signup[]" value="dance class"> <input type="checkbox" name="signup[]" value="yoga class"> ... If you don't use the [], then the variable $signup will contain the last of the (multiple...) checked boxes when the form is submitted. http://www.php.net/manual/variables-from-outside-php.php

« previous php.notes (#12254) next »