Ver Mensaje Individual
  #3 (permalink)  
Antiguo 05/04/2012, 05:29
OwnerMap
 
Fecha de Ingreso: marzo-2012
Mensajes: 13
Antigüedad: 12 años, 1 mes
Puntos: 1
Respuesta: Hacer varias busquedas en un buscador?

mira estube leyendo de implode y explode pero no logre comprenderlos, mas bien meterlos a mi buscador si pudieras ayudarme ? te dejo el codigo dame un ejemplo en mi buscador o una forma de hacerlo no tan dificil o seria editar todo el codigo S:?

Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<link href="tablecloth.css" rel="stylesheet" type="text/css" media="screen" />
<script type="text/javascript" src="tablecloth.js"></script>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>busqueda en tabla</title>
<style type="text/css">

body,td,th {
    font-size: 14px;
    color: #000;
    font-weight: bold;
    text-align: left;
}
a:link {
    color: #F00;
    font-weight: bold;
    text-decoration: none;
}
a:visited {
    text-decoration: none;
}
a:hover {
    text-decoration: none;
}
a:active {
    text-decoration: none;
}
h1,h2,h3,h4,h5,h6 {
    font-weight: bold;
    text-align: center;
}
h1 {
    font-size: 18px;
    color: #000;
    }
.celda {
    color:#fff;
    background-color:#9f0;
}
.celda-gris {
    color:#008;
    background-color:#c0c0c0;
}

h4 {
    font-size: 10px;
    color: #000;
}
#form1 table tr td {
    text-align: center;
}
body {
    margin-top: 22px;
}
.TH2 {
}
.TH2 {
    font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
    font-size: 10px;
    font-weight: bold;
    color: #FFF;
    text-align: center;
}
</style>
</head>
<?
 
//modifica estas variables segn tu servidor de MySQL
$bd_servidor "localhost";
$bd_usuario "root";
$bd_contrasenya "";
$bd_bdname "eromexpresscargo";
 
$bd_tabla "rastreo"// Tabla donde se haran las busquedas
// Conexin y seleccin de la base de datos
$link mysql_connect($bd_servidor,$bd_usuario,$bd_contrasenya);
mysql_select_db($bd_bdname,$link);
 
?>
<body>

  <table width="493" border="1" cellpadding="0">
    <tr>
      <td>Resumen de Rastreo </td>
    </tr>
  </table>
  <table width="740" border="1" align="center" cellpadding="0" cellspacing="0">
    <p><h2></h2>
<tr>
  
  
  <td width="493">Numero de Guia:
  <label for="palabra"></label>
  <input type="text" name="palabra" id="palabra" /> 
    <input type="submit" name="enviar" id="enviar" value="Enviar" /></td>
</tr>
</table>
</form>

<tr>
  <td align="center" valign="top"><table width="745" border="1" align="center" cellpadding=1 cellspacing=1 style="font-size: 8pt; font-weight: normal; color: #FFF;">
    <tr>
      <th><span class="TH2">Numero de Guia</span></th>
      <th class="TH2">Fecha</th>
      <th class="TH2">Medio de Envio</th>
      <th class="TH2">Medio</th>
      <th class="TH2">Puerto de Embarque</th>
      <th class="TH2">Puerto de Descarga</th>
      <th class="TH2">Hora de LLegada</th>
      <th class="TH2">Piezas</th>
      <th class="TH2">Peso Volumetrico</th>
      <th class="TH2">Remitente</th>
      <th class="TH2">Consignatario</th>
      <th class="TH2">Estatus</th>
  </tr>
  
  <?
////////////////////////////
// Proceso del Formulario
///////////////////////////
if(isset($_POST['enviar'])) {
// Solo se ejecuta si se ha enviado el formulario

$query "select * from $bd_tabla where guia LIKE '{$_POST['palabra']}'";
//echo $query;
$result mysql_query($query,$link);
$found false// Si el query ha devuelto algo pondra true esta variable
while ($fila mysql_fetch_array($result)) {
$found true;

echo 
"<p>";

echo 
"<td width=\"19%\"><center>".$fila["guia"]."</td>";

echo 
"<td width=\"5%\"><center>".$fila["fecha"]."</td>";
echo 
"<td width=\"5%\"><center>"$fila["mediodeenvio"]."</td>";
echo 
"<td width=\"10%\"><center>"$fila["vuelo"]."</td>";
echo 
"<td width=\"20%\"><center>"$fila["puertodeembarque"]."</td>";
echo 
"<td width=\"20%\"><center>"$fila["puertodedescarga"]."</td>";
echo 
"<td width=\"10%\"><center>"$fila["horallegada"]."</td>";
echo 
"<td width=\"5%\"><center>"$fila["piezas"]."</td>";
echo 
"<td width=\"15%\"><center>"$fila["pesovolumetrico"]."</td>";
echo 
"<td width=\"100%\"><center>"$fila["remitente"]."</td>";
echo 
"<td width=\"100%\"><center>"$fila["consignatario"]."</td>";
echo 
"<td width=\"100%\"><center>"$fila["estatus"]."</td>";

}
if(!
$found) {
echo 
"No se encontro la guia introducida";
}
}
?>
  </table>
</body>
</html>