Hello, i have a problem with my php code, im student of the high school and we just started doing the php and i would like to do convertor something like cm to dm etc. I started doing some php and here is it, i want someone who has a time to help me do the whole convertor.. here is my code:
<form method="post">
<select name="z">
<option name="Vyber" value="">Vyber</option>
<option name="cm" value="cm">cm</option>
<option name="dm" value="dm">dm</option>
<option name="m" value="m">m</option>
</select>
<select name="do">
<option name="Vyber2" value="">Vyber</option>
<option name="cm2" value="cm">cm</option>
<option name="dm2" value="dm">dm</option>
<option name="m2" value="m">m</option>
</select>
<input type="submit" name="submit" value="GO!" />
</form>
<?php
if(isset($_POST['submit'])){
$selected1 = $_POST['z'];
$selected2 = $_POST['do'];
echo "Z " . $selected1 . ":" . "<form name='final' method='post'><input type='text' />" . "<br>";
echo "Do " . $selected2 . ":" . "<input type='text' />" . "<br>";
echo "<input type='submit' value='Vypocitat!' /></form>";
}
if (isset($_POST['cm'], $_POST['dm2'])){
echo $_POST['cm'] * 10;
}
?>
Aucun commentaire:
Enregistrer un commentaire