Ver Mensaje Individual
  #2 (permalink)  
Antiguo 18/03/2008, 15:59
Avatar de Carlojas
Carlojas
 
Fecha de Ingreso: junio-2007
Ubicación: Shikasta
Mensajes: 1.272
Antigüedad: 16 años, 10 meses
Puntos: 49
Re: Problema con buscador y vinculos

Prueba así tu código:

Código PHP:
<html> 
<head> 
<title>Buscador</title> 
</head> 
<body> 
<H1>Buscador de productos:</H1> 
<form action ="buscar.php" method ="post">
Buscar: <input type = "text" name ="palabra">
<input type="submit" name="buscador" value="Buscar">
</form>
<?php 
include("conectar.php"); 
$link Conectarse();
if(
$_POST['buscador'])
{
   
$buscar $_POST['palabra'];
   if(empty(
$buscar))
   {
       echo 
"No se ha ingresado una cadena a buscar";
   }
   else
   {
       
$result mysql_query("SELECT * FROM productos WHERE codigo LIKE '%$buscar%' ORDER BY  codigo DESC",$link) or die( mysql_error() ); 
   }
?> 
<p>&nbsp;</p>
<table border = "1" cellspacing = "1" cellpadding = "1"> 
<tr>
<th>Codigo</th>
<th>Descripcion</th>
<th>Planos</th>
</tr> 
<?php 
while($row mysql_fetch_array($result)) 

    echo 
'<tr>';
    echo 
'<td>'.$row['codigo'].'</td>';
    echo 
'<td>'.$row['descripcion'].'</td>';
    echo 
'<td><a href =$row[planos]>Descargar</a></td>';
    echo 
'</tr>';

}

mysql_free_result($result); 
mysql_close($link); 
?> 
</table> 
</body> 
</html>
Saludos.

Última edición por Carlojas; 18/03/2008 a las 16:19