I have a simple form with a drop down box. What I'm trying to do is echo different things depending on what is selected. The problem is that no matter which option is selected, the script echoes the first option.
In other words, it seems to be returning the first 'if' as always true.
The html is this...
Code:
<html>
<body>
<form action="myform.php" method="post">
<p>Customer name: <input type="text" name="name" value="[FIRST]" /><br />
</p>
<p>Service requested.</p>
<select name="service">
<option id="entry">VIP Entry</option>
<option id="bottles">Bottle Service</option>
</select>
<select name="venue">
<option id="xs">XS</option>
<option id="tryst">Tryst</option>
<option id="haze">Haze</option>
<option id="other">other</option>
</select>
<p><input type="submit" value="Send it!"></p>
</form>
</body>
</html>
The php is this...
Code:
<?php echo $_POST["name"] ?>
<?php
if ($_POST['service']="entry") {
echo "ENTRY"; }
elseif ($_POST['service']="bottles") {
echo "BOTTLES"; }
else {
echo "NOTHING!"; }
?>