i am trying to create a unit converter but when i click the submit button, nothing happens when the page reloads. could you help me please.
<form action=“converter.php” method=“post”>
<ul class=“ac”>
<li><label>Convert</label></li>
<li><input type=“text” name=“toConvert”/></li>
<li>
<select name=“conv”>
<option name=“conv” value=“pk”>Pounds to Kilograms</option>
<option name=“conv” value=“ci”>Centimeters to Inches</option>
<option name=“conv” value=“pl”>Pints to Litres</option>
<option name=“conv” value=“fc”>Fahrenheit to Centigrade</option>
</select>
<input name=“reverse” type=“checkbox” value=“reverse” />
<label>Reverse</label>
</li>
<li><input type=“submit” name=“submit” value=“Go” /></li>
<li><label>Result:</label><label><?php echo $theResult ?></label></li>
</ul>
</form>
<!-- php here –>
<?php
switch($_POST[conv]){
case “pk”:
$theResult = $_POST[toConvert] * 0.45359237;
break;
case “ci”:
$theResult = $_POST[toConvert] * 0.393700787;
break;
default:
$theResult = “result here”;
}
?>