EL formulario esta en el div con id="introducir"
Código HTML:
Ver original<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script> <script type="text/javascript"> function getdatos(value){
$.post("getdatos.php", {partialdato:value}, function(data){
$("#results").html(data);
});
}
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> body {
font-style:italic;
margin: 0 auto;
font-family: arial;
text-align:center;
background-color: #F0F0F0;
vertical-align:center;
background-image:url(fondo-cabecera.png);
background-repeat:repeat-x;
}
table.fija{table-layout: fixed}
#cabecera{
background-color:#000;
background-repeat:repeat;
margin-top:40px;
margin-bottom:60px
}
#introducir{
margin-top:60px;
margin-bottom:20px;
border:solid 9px #626262;
width:950px;
}
#tabla1{
font-weight: bold;
color: #F0F0F0;
height:auto;
width:auto;
overflow: hidden;
class="fija";
font-family: Arial;
font-size: 20px;
font-style: normal;
line-height: normal;
text-transform: capitalize;
}
#parte2{
background-color: #F0F0F0;
color:#000000;
}
#tabla1 .fija {
color: #FF0000;
}
#busqueda{
color:#CCCCCC;
text-align: left;
font-family: georgia;
font-size:14px;
font-style:italic;
margin-bottom:30px;
}
#busqueda2{
font-family:Georgia;
font-style:italic;
font-size: 56px;
color: #CCC;
background-color: #F0F0F0;
}
#general{
width:960px;
margin: 0 auto;
}
#columanas_principales {
font-family: Arial;
font-weight:bold;
font-size:14px;
color: #000;
}
p {
font-family: Arial;
font-size: 12px;
font-weight:normal;
}
.lupa{
background: white url(lupa.png) no-repeat 866px center;
width:950px;
}
#barra{
background-repeat:repeat;
background-image: url(BARRA-INFERIOR.jpg);
}
#results{
font-family:arial;
font-size:12px;
color:#000;
line-height:120%;
margin-top:-40px;
margin-bottom:10px;
}
.par{
background-color:#CCC;
}
.impar{
background-color:#F0F0F0;
}
.centrado{
text-align:left;
font-family:arial;
font-size:14px;
font-weight:bold;
width:60px;
padding-left:12px;
}
.nombre{
font-family:arial;
font-size:14px;
font-weight:bold;
height:44px;
width:300px;
padding-left:12px;
}
.mail{
width:260px;
padding-left:12px;
}
.departamento{
width:160px;
padding-left:12px;
}
<div id="logoied" align="right"><img src="logo-izq.png" width="127" height="25" alt="buscar" align="left" /> <img src="logo-ied2.png" width="70" height="32" alt="buscar" />
<input name="campo" type="text" class="lupa" id="busqueda2" onKeyUp="getdatos(this.value)" size="32" alt="busca por nombre o email" > <img src="ojo2.png" width="25" height="17" alt="buscar" /> B
úscame por mi nombre, mail, o departamento
</br></div></br><div class="fija" id="tabla1">
<table width="960" height="26" class="fija" > <td width="300" height="20">Nombre
</td> <td width="260">Mail
</td> <td width="160" >Departamento
</td> <td width="60" class="centrado">Ext.
</td>
<table id="results"width="960" height="24" class="fija" >
<img src="BARRA-INFERIOR.jpg" width="1" height="2" alt="buscar" />
<p align="right"><img src="logoizqabajo.png" width="95" height="15" alt="buscar" align="left"/><img src="logodrchabajo.png" width="61" height="28" alt="buscar" /></p> <img src="derechos.png" width="191" height="9" alt="buscar" align="left" style="margin-top:-20px"/>
Código PHP:
Ver original<?php
header('Content-Type: text/html; charset=ISO-8859-1'); $partialdatos = $_POST['partialdato'];
$datos= mysql_query("SELECT * from datos where todo LIKE '%$partialdatos%'");
if ($impar)
{
echo '<tr class="impar"><td class="nombre">'.$dato['nombre_apellido'].'</td>';
echo '<td class="mail" >'.$dato['email'].'</td>';
echo '<td class="departamento">'.$dato['departamento'].'</td>';
echo '<td class="centrado">'.$dato['extension'].'</td></tr>';
$impar = false;
}
else
{
echo '<tr class="par"><td class="nombre">'.$dato['nombre_apellido'].'</td>';
echo '<td class="mail">'.$dato['email'].'</td>';
echo '<td class="departamento">'.$dato['departamento'].'</td>';
echo '<td class="centrado">'.$dato['extension'].'</td></tr>';
$impar = true;
}
}
?>