Ver Mensaje Individual
  #5 (permalink)  
Antiguo 02/07/2004, 12:52
Edhoru
 
Fecha de Ingreso: octubre-2003
Mensajes: 19
Antigüedad: 20 años, 6 meses
Puntos: 0
No te preocupes, fue bastante ayuda

Aquí está el script final.

hace un dropdown alimentado por una bd sin repetir valores, crea una variable que se llama prod y la envía a buscar.php

Código PHP:
<html> 
<head> 
<title>Documento sin t&iacute;tulo</title> 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 
</head> 
<body> 
<? mysql_connect("localhost""user""pass"
or die(
"Could not connect to database."); 
mysql_select_db("base_de_datos") or 
die(
"Cannot select database");                 
    
$result mysql_query("select distinct producto from catalogo") or die( mysql_error() ); 

    echo 
"<form name='form1' method='post' action='busca.php'><select name='prod' size='1'>";         

    while (
$row mysql_fetch_array($result)) 
    {               

    echo 
"<option selected>$row[producto]</option>";

     } 
    echo 
"<input type='submit' name='submit' value='buscar'>"
    echo 
"</form>"
?> 
</body> 
</html>