Ver Mensaje Individual
  #1 (permalink)  
Antiguo 27/11/2013, 18:49
sahe_lizzy
 
Fecha de Ingreso: noviembre-2013
Ubicación: México
Mensajes: 22
Antigüedad: 10 años, 5 meses
Puntos: 0
Pregunta como puedo con option value (lista) al darle click mostrar informacion de una BD

Hola Soy nueva en esto de la programación y tengo una duda resulta que tengo un menú desplegable al cual quiero que cada vez que yo le doy clic me cambie ciertos datos del formulario que yo aquí le mostrare en mis consultas (query) las tengo con un hotel especifico la idea es que no sea así si no con la lista elegirlo ¿Cómo le puedo hacer?



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Secturdf | SIAT</title>
<script type="text/javascript" src="simpletreemenu.js"></script>
<link rel="stylesheet" type="text/css" href="simpletree.css" />
<link rel="stylesheet" type="text/css" href="estilos/style.css" />
<link href="templatemo_style.css" rel="stylesheet" type="text/css" />
</head>

<?php

$imagen=mysql_query("SELECT imagen_h from tabla_hoteles where nombre_hotel='Hotel Emporio'") or die(mysql_error());
$fet= mysql_fetch_array($imagen);
//AQUI MANDO TRAER LA IMAGEN DE ESTE HOTEL

$sq2 = mysql_query("SELECT * FROM tablas_hoteles WHERE nombre_h='Hotel Emporio'") or die(mysql_error());
$ro2 = mysql_fetch_array($sq2); //AQUI EL NOMBRE DE LA BASE DE DATOS DEL HOTEL
?>


<form name="form3" method="post" action="disfruta2.php">

<table class="centrada" border="1" >
<tr>
<td><p><a href=""><img src="disfruta/secturdf.jpg " border="0" width="80" height="60"></a></p></td>
<td><p><a href=""><img src="disfruta/disfruta.jpg " border="0" width="80" height="60"></a></p></td>
</tr>


</table>
<table class="centrada" border="1">
<tr>
<td class="normal"colspan="5"><img src="imagenes/hoteles/<?php echo $fet['imagen_h'];?>" height="100"></a></td>
</tr>
<tr>
<td class="normal" colspan="2">Hotel<br><input type="text" name="nombre_h" size="30" value="<?php echo $ro2['nombre_h']; ?>" disabled style="font-weight:bold;"> </td>
<td class="normal">Cuartos<br><input type="text" name="cuartos_h" size="7" value="<?php echo $ro2['cuartos_h']; ?>" disabled style="font-weight:bold;"></td>
</tr>


<td>Hotel:</td>
<td><select name="hotel_dx">
<option value ="emporio">nh santa fe </option>
<option value ="benidor">benidorm</option>
<option value ="best western royal zona rosa">best western hotel royal zona rosa</option>
<option value ="brasilia">brasilia</option>
<option value ="camino real aeropuerto">camino real aeropuerto</option>
</select>
<!--COMENTARIO: LA IDEA ES QUE CON ESTE MENU DESPLEGABLE TANTO EL NOMBRE, LA IMAGEN Y EL NUMERO DE CUARTOS CAMBIEN-->
</td>
<!--<td><input type="text" size="15" maxlength="30" value="" name="hotel_dx"></td>-->
</tr>
<tr>
<td>Total de Cuartos:</td>
<td><input type="text" size="15" maxlength="30" value="" name="cuartos_dx"></td>
</tr>
<tr>
<td>Fecha:</td>
<td><input type="text" size="15" maxlength="30" value="" name="fecha_dx" placeholder="aaaa-mm-dd"></td>
</tr>
<tr>
<td>Ocupaci&oacute;n Nacional:</td>
<td><input type="text" size="15" maxlength="30" value="" name="tnac_dx"></td>
</tr>
<tr>
<td>Ocupaci&oacute;n Extranjera:</td>
<td><input type="text" size="15" maxlength="30" value="" name="text_dx"></td>
</tr>
<tr>
<td>
<p>
<input type="submit" name="enviar" id="enviar" value="Enviar" />
<!--<input type="button" name="guardar" value="Guardar" onclick="checar()">-->


</p>
<p>&nbsp;</p>


</td>


<td>
<p>
<input type="reset" value="Borrar">
</p>
<p>&nbsp;</p>


</td>
</tr>

</table>
</form>

Última edición por sahe_lizzy; 27/11/2013 a las 18:55