
Crear Buscador
Publicado por Kelvin (3 intervenciones) el 01/10/2014 00:49:00
Hola, les cuento que estoy intentando crear un buscador con consulta desde la base de datos, estoy bien al buscarlo pero no tengo idea de como enviar lo que selecciono mediante un checkbox y enviarlo a otra pagina.
aca les muestro el buscador:
aca les muestro el buscador:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<form id="busqueda" name="busqueda" action="<?php $_SERVER["PHP_SELF"]?>"method="get">
<input type="submit" name="buscar" id="buscar2" value="Buscar" />
<label for="textfield"></label>
<input type="text" name="dato" id="dato2" />
<input name="opcion" type="hidden" id="opcion" value="20">
<input name="menu" type="hidden" id="menu" value="10">
</form>
<form action="buscador.php" method="GET">
<?php if (isset ($_GET["buscar"])) {
$sql= "SELECT * FROM tblproveedores WHERE tblproveedores.strproveedor LIKE '%" . $_GET['dato']."%'";
$res=mysql_query($sql) or die("ERROR EN LA CONSULTA ". mysql_error());
$num_rows = mysql_num_rows($res);
echo '<table width="80%" border="0" cellspacing="3" cellpadding="1">
<td>
<input type="submit" name="agregar" value="Agregar"></td>' ;
while(list($idproveedor, $proveedor)=mysql_fetch_row($res)){
echo '<tr>
<td><input type="checkbox" name="seleccion[]" value="'. $idproveedor. '">'.$proveedor.
'</td>
</tr></table>';
}
}
mysql_free_result($buscar);
?>
</form>
Valora esta pregunta


0