php & html
| From: | pedro | Date: | Thu, 24 Apr 2003 19:33:30 +0000 |
| Subject: | php & html | ||
| Groups: | php.general.es | ||
| Request: | Send a blank email to general-es+get-35504@lists.php.net to get a copy of this message | ||
Hola...
1.Tengo un control "select" que lleno desde una base de datos, y quiero que
cuando el usuario seleccione uno se sus campos automaticamente ir a otro
fichero .php para mostrar el resultado de la búsqueda.
les paso el código, gracias.
2. Genero tabla '<table>' segun los resultados de un select a una desde una base de
datos, como puedo:
según una determinada cantidad de líneas cortas para otra página.
P.D Código de la pregunta uno.
<link rel="stylesheet" href="jscss/sty.css" type="text/css">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { file://reloads the window if Nav4 resized
if (init==true) with (navigator) {if
((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight;
onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH)
location.reload();
}
MM_reloadPage(true);
file://-->
</script>
<Table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
<TABLE width="200" cellSpacing=0 cellPadding=0 border="0">
<TBODY>
<TR>
<TD><IMG src="images/tabs_active_left.gif" alt="" width=10
height=22 border=0></TD>
<TD class=ActiveTab rowSpan=2><A class=ActiveTab>Hotels</A></TD>
<TD><IMG height=22 alt="" src="images/tabs_active_right.gif"
width=10 border=0></TD>
<TD><IMG height=22 alt="" src="images/tabs_inact_left.gif"
width=10 border=0></TD>
<TD class=InactiveTab><A class=Tabs
href="index.php?id=2">Excursions</A></TD>
<TD><IMG height=22 alt="" src="images/tabs_inact_right.gif"
width=10 border=0></TD>
<TD><IMG height=22 alt="" src="images/tabs_inact_left.gif"
width=10 border=0></TD>
<TD class=InactiveTab><A class=Tabs
href="index.php?id=3">Packages</A></TD>
<TD><IMG height=22 alt="" src="images/tabs_inact_right.gif"
width=10 border=0></TD>
</TR>
</TBODY>
</TABLE>
</td>
</tr>
<tr class="ActiveTab">
<td>
<table width="322" border="0" cellpadding="2"
cellspacing="2">
<tr>
<td align="right"><font
class="CurrentPage">Search</font></td>
<td></td>
</tr>
<tr align="center">
<td width="103" align="right"><font
class="cadena">Hotel</font>
</td>
<td width="209" align="left">
<?
$conn = odbc_connect("bdctt", "", "");
$query = odbc_exec($conn, "select codihote, nombhote from thote order by
2");
$cont01 = 0;
while(odbc_fetch_row($query))
{
$do_codihote[$cont01] = odbc_result($query,"codihote");
$do_nombhote[$cont01] = odbc_result($query,"nombhote");
$cont01++;
}
echo "<form name='form1' method='post' action='' >";
?>
<select name="select" class="cadena">
<? $a = 0; ?>
<option>-seleccione un hotel-</option>
<? while ( ($cont01) <> $a) { ?>
<option > <? echo $do_nombhote[$a]?> </option>
<? $a++ ; }
odbc_close_all; ?>
</select>
</td>
</tr>
<tr>
<td align="right"><font
class="cadena">Destination/Category</font>
</td>
<td><select name="ndestino" class="cadena">
<option>HAVANA/5 stars</option>
<option>HAVANA/4 stars</option>
<option>HAVANA/3 stars</option>
<option>BEACHES/5 stars</option>
<option>BEACHES/4 stars</option>
<option>BEACHES/3 stars</option>
<option>OTHER CITIES/5 stars</option>
<option>OTHER CITIES/4 stars</option>
<option>OTHER CITIES/3 stars</option>
</select>
</td>
</tr>
<? echo "</form>" ?>
</table>
<hr>
<?
$id_hoteles=$HTTP_GET_VARS['id_hoteles_searchs'];
switch ($id_hoteles) {
case 1:
include("hoteles_items.php");
break;
case 2:
include("Hoteles_Description.php");
break;
default:
include("hoteles_items.php");
// estado default .. nos determina el estado
// "si no es ninguna opcion de las anteriores".
}
?>
</td>
</tr>
</Table>