Ver Mensaje Individual
  #3 (permalink)  
Antiguo 03/09/2003, 09:21
Avatar de mveraa
mveraa
 
Fecha de Ingreso: diciembre-2002
Ubicación: santiago-chilito
Mensajes: 1.931
Antigüedad: 21 años, 2 meses
Puntos: 2
bueno es la misma respuesta de la otra pregunta , este codigo toma valores de una base en este caso toma marcas de vehiculos y en base a esta selecciona los modelos , espero te sirva.

saludos



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<style type="text/css">
<!--
input { font-family: Tahoma, Verdana, Arial; font-size: 11px; color: #FFFFFF; background-color: #6699CC; border: #000099; border-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px}
select { font-family: Tahoma, Verdana, Arial; font-size: 11px; color: #FFFFFF; background-color: #6699CC; border: #000099; border-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px}

-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //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);
//-->
</script>
</head>

<body background="/seletjava/fondo_mosaico.jpg">
<?php

include ('base.php');

$consulta="SELECT DISTINCT MARCA from autos order by TIPO" ;
$res=mysql_query($consulta) or die ("consulta fallo2");
$num=mysql_num_rows($res);

?>
<em><strong><font size="5">SELECCIONE VEHICULO</font></strong></em>
<p><font size="2"><h3>MARCAS:</h3></font></p>
<form name="form1" method="post" action="">

<select name="sfile0" style="font-family:arial; fonf-weight:bold; font-size:15pt; width:190px; height:50px;">
_<option>SELECCION</option>

<?php
For ($i=0;$i<$num;$i++)
{
$a=mysql_result($res,$i,0);


echo "<option value=\"".$a."\">".$a;


}

ECHO"</td><BR>";
ECHO "<BR>";
echo "<td width=\"75%\"><input type=submit name=boton2 value=BUSCAR>";
ECHO "</FORM></td><BR>";

mysql_close();

?>
</select>

</p>

</p>
</form>
<form method=post target="mainFrame" action=/seletjava/tabla_modelos.php >
<input type=hidden name=sfile0 value="<?php ECHO $sfile0; ?>">
<input type="submit" name="Submit2" value="VER TODOS LOS MODELOS <?php ECHO $sfile0; ?> ">
</form>

<?php




include ('base.php');



$consulta="SELECT DISTINCT modelo from autos where marca='".$sfile0."'" ;

$res=mysql_query($consulta) or die ("consulta fallo2");
$num=mysql_num_rows($res);


?>

<form name="form2" method="post" target="mainFrame" action=tabla.php>



<input name=sfile0 style="visibility:hidden" value="<?php echo $sfile0 ?>" >

<p><font size="2"><?php echo "<h3>$num" ;echo " ";?>MODELO(S) :<?php ECHO $sfile0;echo "</h3>"; ?></font></p>
<select name="sfile1" style="font-family:arial; fonf-weight:bold; font-size:15pt; width:200px; height:90px;">



<?php

For ($i=0;$i<$num;$i++)
{
$a=mysql_result($res,$i,0);


echo "<option value=\"".$a."\">".$a;
}

ECHO"</td>";

echo "<td width=\"75%\"><input type=submit name=boton2 value=BUSCAR>";
ECHO "</FORM></td><BR>";

mysql_close();
?>
</select>

</p>
<em> <font size="2">
<form method=get target="mainFrame" action=/seletjava/stock.php >
<input type="submit" name="Submit4" value="VER TODO EL SCTOCK">
</form>
</font> </em> </p>
<p>&nbsp;</p>
</form>
</body>
</html>