I have been trying to work out, why my php code will not retain the drop down box selection after the submit has been pressed, but haven’t been able to work it out. Could someone please tell me how I can get this to work? Thank in advance.
<select name="nature">
<option value="none1">Please Select</option>
<?php if (isset($_POST['submitbtn']) == true) { ?>
<?php $getstarted1 = "<option value=\\"getstarted\\" selected=\\"selected\\">Get Started</option>";
echo $getstarted1; ?>
<?php } else { ?>
<?php $getstarted2 = "<option value=\\"getstarted\\">Get Started</option>";
echo $getstarted2; ?>
<?php } ?>
<?php // drop down box
if (isset($_POST['submitbtn']) == true) { ?>
<?php $quote1 = "<option value=\\"quote\\" selected=\\"selected\\">Quote</option>";
echo $quote1; ?>
<?php } else { ?>
<?php $quote2 = "<option value=\\"quote\\">Quote</option>";
echo $quote2; ?>
<?php } ?>
</select>