Passing entry from HTML drop down menu to php variable?

YKM

New member
This doesn't work and I'm not able to figure out why:

<html>

<br><br>
<form name="input" method="GET">
Brand: <br>
<select name="brand">
<option size =30 selected>Select</option>
<option value= "A">A</option>
<option value = "B">B</option>
</select>

</form>
<?php
$brand = $_GET['brand'];
echo "Brand: $brand<br>";
?>
</html>

What alterations should I make for it to work?

I would like the page to display

brand: A

if A was selected in the drop down... Hence save the value A in $brand variable

Thank you very much!!

Quick best answer would just be the code modified to be working. Thanks again!
 
Back
Top