xoops forums

Agent00

Just popping in
Posted on: 2006/1/17 19:56
Agent00
Agent00 (Show more)
Just popping in
Posts: 9
Since: 2005/11/16
#1

HTML Drop down list values to PHP values

Hi,

I try to get the value from a html drop down list(when the user selected certain values from the list) then set it to a php variable, but I was unable to do it, can anybody help me!


ex: html
<select id='num'>
<option> 1 </option>
<option> 2 </option>
<option> 3 </option>
</select>

if the user selected 3, how can I set that value to a php variable.

thanks

Jason

iver2435

Just popping in
Posted on: 2006/1/20 6:51
iver2435
iver2435 (Show more)
Just popping in
Posts: 10
Since: 2006/1/19
#2

Re: HTML Drop down list values to PHP values

I'm going to assume a couple of things here...

1) This is a part of some kind of form that goes on a website, like an order form or something.

2) After they fill out the form, they click "Submit" or "Order" or whatever.

3) The PHP script will take over and process it from there...

If those three assumptions can be made, then you can accomplish it very simply by extracting it from the $HTTP_POST_VARS array when you pass it to the PHP script.

I am still a little bit of a noob at PHP, so if I am wrong on this one, please let me know...