Re: passing variable arguments from <select>
| From: | Erik Price | Date: | Wed, 26 Jun 2002 19:23:56 +0000 |
| Subject: | Re: passing variable arguments from <select> | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-104042@lists.php.net to get a copy of this message | ||
On Wednesday, June 26, 2002, at 02:51 PM, Haddad Said wrote:
Hi, i am having a problem passing variables from a drop down menu in a form; <from action=test.php action=post> <select name=example> <option selected> one</option> <option> two</option> </form>You should do it like this (be sure to properly quote your attributes, and use the 'value' attribute of the 'option' tag): print "<form action='test.php' method='post'> <select name='example'> <option selected='yes' value='1'>One</option> <option value='2'>Two</option> </select> </form>\n"; In the "test.php" page, the selected value will be found in the $_POST['example'] variable. Erik ---- Erik Price Web Developer Temp Media Lab, H.H. Brown pricee@hhbrown.com