Hi. I´m trying to do a form with two selects. Now they works great, but... when I try to "recover" the information in another .php file, doesn´t work and only have warnings, and not see nothing.
The script I´m trying at the final is to develop a first select and depending on the option selected the information of the second will be appear... but, that thing right now is not important...
I´m having problems to see the information of the selects of the main page ( form.php )... and recover them in the second ( busca.php )...
Please, I tryed all kind of variables, and more, and I´m sttoped with this code...
Can anybody help me, please???
CODE form.php:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>inicio</title>
</head>
<?php
// Provincias de España
$provincias = array("A Coruña", "Madrid","A Coruña", "Álava", "Albacete", "Alicante", "Almeria", "Asturias", "Ávila", "Badajoz", "Baleares", "Barcelona",
"Burgos", "Cáceres", "Cádiz", "Cantabria", "Castellón", "Ceuta", "Ciudad Real", "Córdoba",
"Cuenca", "Girona", "Granada", "Guadalajara", "Guipúzcoa", "Gran Canaria", "Huelva",
"Huesca", "Jaén", "La Rioja", "Las Palmas", "León", "Lleida", "Lugo", "Madrid",
"Málaga", "Melilla", "Murcia", "Navarra", "Ourense", "Palencia", "Pontevedra",
"Salamanca", "Tenerife", "Segovia", "Sevilla", "Soria", "Tarragona",
"Teruel", "Toledo", "Valencia", "Valladolid", "Vizcaya", "Zamora", "Zaragoza" );
// localidades de Madrid
$madrid = array ( "Alcalá de Henares", "Alcobendas", "Alcorcón", "Aldea del Fresno", "Alpedrete", "Aranjuez", "Arganda del Rey",
"Arroyomolinos", "Alcalá de Henares", "Alcobendas", "Alcorcón", "Aldea del Fresno", "Alpedrete", "Aranjuez", "Arganda del Rey",
"Arroyomolinos", "Batres", "El Berrueco", "Boadilla del Monte", "El Boalo", "Buitrago del Lozoya", "La Cabrera", "Cadalso de los Vidrios",
"Cenicientos", "Chinchón", "Collado Mediano", "Collado Villalba", "Colmenar de Oreja", "Colmenar Viejo", "Coslada", "El Escorial",
"Fresnedillas de la Oliva", "Fuenlabrada", "Fuente el Saz de Jarama", "Fuentidueña de Tajo", "Galapagar", "Getafe", "Guadarrama",
"Humanes de Madrid", "Leganés", "Loeches", "Madrid", "Majadahonda", "Manzanares el Real", "Mejorada del Campo", "Móstoles",
"Navacerrada", "Navalagamella", "Navalcarnero", "Nuevo Baztán", "Parla", "Patones", "Pinto", "Pozuelo de Alarcón",
"Puebla de la Sierra", "Puentes Viejas", "Rascafría", "Robledo de Chavela", "Las Rozas de Madrid", "San Fernando de Henares",
"San Lorenzo de El Escorial", "San Martín de la Vega", "San Martín de Valdeiglesias", "San Sebastián de los Reyes",
"Santa María de la Alameda", "Santorcaz", "Talamanca de Jarama", "Torrejón de Ardoz", "Torrejón de Velasco", "Torrelaguna",
"Torrelodones", "Valdemaqueda", "Valdemorillo", "Valdemoro", "Villaconejos", "Villanueva de la Cañada", "Villar del Olmo",
"Villarejo de Salvanés" );
?>
<body bgcolor="#FFFFFF">
<center>
<form METHOD="POST" action="busca.php" name=frminsertar>
<table border="1">
<tr>
<td>PROVINCIA:<br>
<select name=provincia>
<?php
$cuenta = array_count_values ($provincias);
$i = 0;
reset($provincias);
foreach ($provincias as $value )
{
echo "<option value='".$provincias[$i]."'>".$provincias[$i]." </option>";
$i++;
}
?>
</td>
<td>LOCALIDAD: <br>
<select name=localidad>
<?php
$cuenta2 = array_count_values ($madrid);
$ix = 0;
reset($madrid);
foreach ($madrid as $value=>$loc )
{
echo "<option value='".$madrid[$ix]."'>".$madrid[$ix]."</option>";
$ix++;
}
?>
</select>
</td>
</tr>
</table>
<br>
<br>
<input name="submit" type="submit" value="enviar">
</center>
</form>
</body>
</html>
CODE busca.php---- Here I want to recover, or see the information from the selects... HERE I HAVE PROBLEM !!!!!
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin título</title>
</head>
<body>
<?php
$provdata='';
$provdata=$_POST['provincias'];
echo $provdata;
?>
</body>
</html>
If anybody know how to fix this, please, can you help and and tell me what I have to do to see the results in this page??
Thanks a lot for your help.