Page 1 of 1

if statement from dropdown menu

Posted: Sun Nov 09, 2008 9:15 pm
by ganza
hi all,

is it possible for me to make an if statement from dropdown menu value?
so example like this

Code: Select all

<form id="Status" name="Status" method="post" action="">
  <select name="status" >
  <option value="0" selected="selected">SELECT!</option>
  <option value="1">one</option>
  <option value="2">two</option>
  <option value="3">three</option>
  </select>
</form> 
 
and i want to made an if statement using the value of the dropdown menu
 
if(isset($_REQUEST["Submit"]) == true) && ($_REQUEST["value"]) == 1)
{ 
i try the code like that and it isnt working ....

Re: if statement from dropdown menu

Posted: Sun Nov 09, 2008 11:20 pm
by ramya123
use name of dropdown i.e.,($_REQUEST["status"])
instead of ($_REQUEST["value"])

Re: if statement from dropdown menu

Posted: Sun Nov 09, 2008 11:27 pm
by pcoder
You can easily make an if statement from the dropdown value.
Try this to test the request value.

Code: Select all

print_r($_REQUEST);
Then you can control the statement.
8)