Ver Mensaje Individual
  #1 (permalink)  
Antiguo 26/07/2013, 08:38
Novato2013
 
Fecha de Ingreso: junio-2013
Ubicación: Madrid
Mensajes: 61
Antigüedad: 10 años, 10 meses
Puntos: 5
Recargar página en función del $_POST

Hola,

Tengo un select creado al cual llegan los datos desde la base de datos, quiero que cuando el usuario seleccione una d las opciones y haga click en un botón q he creado, se recargue la página, no sé porque no me funciona el código q he creado, aparte d por mi inexperiencia programando, alguna sugerencia?os pego el código:

Código PHP:
Ver original
  1. <form method="post" action="./?Lang=".$SetLanguage."&Page=".$SetPage."">
  2.                                 <label for="CountryInput"><?php echo $arrMainPage[$MainPageCountry]["TextHeader"]; ?></label>
  3.                                     <select name="CountryInput" value=".$_POST['CountryInput']." >
  4.                                         <option><?php echo $arrMainPage[$MainPageSelectOne]["TextHeader"]; ?></option>
  5.                                         <?php
  6.                                                                                
  7.                                         $rcsCountry = $cardata->query($qryCountry);
  8.    
  9.                                         while ($row = $rcsCountry->fetch_array(MYSQLI_BOTH)) {
  10.                                             if ($row["CountryDescription"] == $CountryInput) {
  11.                                                 $CountrySelected = "selected";
  12.                                             } else {
  13.                                                 $CountrySelected = "";
  14.                                             }
  15.                                             ?><Option<?php echo $CountrySelected; ?> value="<?php echo $row["CountryDescription"]; ?>"><?php echo $row["CountryDescription"]; ?></option>
  16.                                         <?php
  17.                                         }
  18.                                        
  19.                                         echo "</select>"
  20.                                         ?>
  21.                                     </select>  
  22.                                 </form>
  23.  
  24. <input type="submit" name="CountryInput" id="searchbutton" value="$_POST['CountrySelected']" />

Muchas gracias de antemano.