hola tengo este pero no me trae nada no funciona no hace nada... ya esta conectado a su base de datos, no la coloco porq ya es sabiado q se necesita incluir de todas formas include("conexion.php"); listo
Código:
<div id=dependiente>
<!--Combo principal-->
<select name="regimen" onChange="redirect(this.options.selectedIndex)" style='width:160'>
<option value=0>Regimen</option>
<?
$res = mysql_query("SELECT id_regimen, regimen FROM regimenes ORDER BY regimen");
while($rw = mysql_fetch_array($res))
echo "<option value='".$rw['id_regimen']."' ";
if(isset($_POST['regimen']) && !empty($_POST['regimen']) && ($_POST['regimen']== $rw['id_regimen']) )
echo 'selected';
echo ">";
echo $rw['regimen'];
echo "</option>";
?>
</select>
<!--Combo dinámico-->
<select name="afiliadora" style='width:200px'>
<option value=0>Afiliadoras</option>
<?
if(isset($_POST['id_regimen']) && !empty($_POST['id_regimen']))
{ $res = mysql_query("SELECT id_afiliadora, id_regimen, nom_afiliadora
FROM entidades_afiliadoras WHERE id_regimen='".$_POST['id_regimen']."'
ORDER BY nom_afiliadora");
while($rw = mysql_fetch_array($res))
echo "<option value='".$rw['id_afiliadora']."' >";
echo $rw['nom_afiliadora'];
echo "</option>";
}
?>
</select>
</div>