Ayuda formulario

Nordin
02 de Marzo del 2010
Hola a tod@s,

Necesito ayuda para terminar este codigo php para un formulario con un menu de seleccion,
tengo dificultad en hacer que salga el precio de las combinaciones de origen y destino en el textbox, claro esta acorde a un lista de precios ya fija, por ejemplo:

Aeropuerto Ferney Voltaire 20 euros
Ferney Voltaire Gare Cornavin 30 euros
Gare Cornavin Aeropuerto 25 euros
O.N.U Gare Cornavin 18 euros


<form method="post">
<p>
<select name="origen">
<option value="Aeropuerto">Aeropuerto</option>
<option value="Ferney Voltaire">Ferney Voltaire</option>
<option value="Gare Cornavin">Gare Cornavin</option>
<option ="O.N.U">O.N.U</option>
</select>

<select name="destino">
<option value="Aeropuerto">Aeropuerto</option>
<option value="Ferney Voltaire">Ferney Voltaire</option>
<option value="Gare Cornavin">Gare Cornavin</option>
<option ="O.N.U">O.N.U</option>
</select>
<br /><br /><br /><input type="submit" value="Calcule su tarifa" />
<br /><br />
<input name="result" size="10" readonly="readonly" maxlength="30" /> Euros
</p>
</form>
<?php
function taxi($origen)
{
$por_defecto = '';
$origen=$_post['origen'];
$destino=$_post['destino'];

if (isset($_POST['origen']))
{
if ($_POST['origen'] == $origen)
{
$por_defecto='selected="selected"';
}
}

}

if (isset($_POST['destino']))
{
if ($_POST['destino'] == $destino)
{
$por_defecto='selected="selected"';
}
}

if (isset($_POST['destino']))
{
echo '<p>Origen: ' . htmlspecialchars($_POST['origen']) . '</p>';
echo '<p>Destino: ' . htmlspecialchars($_POST['destino']) . '</p>';
}

?>