Ver Mensaje Individual
  #8 (permalink)  
Antiguo 26/01/2008, 12:57
Avatar de GatorV
GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años, 9 meses
Puntos: 2135
Re: Presentación y primera duda!

Es sencillo, haces tu formulario:
Código HTML:
<form action="recibe.php" method="post">
<select name="nivel"></select>
<input type="submit" value="Aleatorio" name="obtener" />
</form> 
Luego haces tu pagina recibe:
Código PHP:

// Primero conectas a tu BD
$nivel $_POST['nivel'];//recoges el nivel

$con mysql_query("SELECT combinacio FROM tabla WHERE nivel=$nivel ORDER by RAND() LIMIT 1");

$row mysql_fetch_row$con );
echo 
"Valor aleatorio: " $row[0]; 
Saludos.