Tengo una pagina :
Código PHP:
   <title>Preloader en AJAX</title>
<script language="javascript" type="text/javascript">
 
var UltFec;
 
function objetoAjax(){
    var xmlhttp=false;
    try{
        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    }catch(e){
        try{
           xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }catch(E){
            xmlhttp = false;
          }
    }
 
    if(!xmlhttp && typeof XMLHttpRequest!='undefined'){
        xmlhttp = new XMLHttpRequest();
    }
    return xmlhttp;
}
 
 
function NuevoAjax(){
var xmlhttp=false;
try{
    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}catch(e){
    try{
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
     }catch(E){
        xmlhttp = false;
    }
}
 
if(!xmlhttp && typeof XMLHttpRequest!='undefined'){
    xmlhttp = new XMLHttpRequest();
}
return xmlhttp;
}
function Cargar(url){
 
 
var cod=document.getElementById("cod").value;
var contenido,nombre;
contenido = document.getElementById('contenido');
//pepe = document.getElementById('pepe');
ajax=NuevoAjax();
ajax.open("GEST", url,true);
ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
ajax.send("v="+cod);
 
ajax.onreadystatechange=function(){
    if(ajax.readyState==1){
        preloader.innerHTML = "Cargando...";
        preloader.style.background = "url('bariloche.jpg') no-repeat";
    }else if(ajax.readyState==4){
        if(ajax.status==200){
            contenido.innerHTML = ajax.responseText;
            preloader.innerHTML = "Cargado.";
            // imagen se carga dentro de cargando
            preloader.style.background = "url('bariloche.jpg') no-repeat";
        }else if(ajax.status==404){
            preloader.innerHTML = "La página no existe";
        }else{
            preloader.innerHTML = "Error:".ajax.status;
        }
    }
}
 
 
}
    
</script>
</head>
<body>
 
 
<form action ='basededatos2.php' method='POST' onClick=javascript:Cargar('basededatos2.php')>
                 Nombre: <INPUT id="cod" TYPE="text" NAME="nombre" value="123"><br>
                 <input type='submit' value='Buscar'>
                 </form>
 
<script>document.write(valorx) </script>
<div id="contenido"></div> 
   Código PHP:
   <?php session_start(); ?>
<html>
<head><title>mysql</title></head>
<body>
<?php 
 
    $fnom= $_POST['v'];
    $fnom2= $_POST['nombre'];
    echo $fnom." nada ".$fnom2;
 
include("servidor.php");//Abrimos conexion
$conexion=mysql_connect(HOST,USUARIO,PASS) or die ("Hay un error en la conexion de la base de datos(host, name o pass)");
 
//Seleccionamos BD
$bd =mysql_select_db(BASE,$conexion) or die ("No existe base de datos");
 
//Hacemos consulta
$consulta= "SELECT * FROM proyecto WHERE nombre='$fnom'";
$resultado=mysql_query($consulta) or die ("No hay tablas");
echo $fnom."dsdsdsdsd";
echo mysql_num_rows($resultado);
 
echo "<table border='1' >";
while($fila =mysql_fetch_array($resultado,MYSQL_ASSOC)){
    extract($fila);
    echo "<tr><td>".$id_proyecto."</td>";
    echo "<td>".$NOMBRE."</td>";
    echo "<td>".$APELLIDOS."</td>";
    echo "<td>".$EDAD."</td></tr>";
}
echo"</table>";
 
 
 
 
 
//Cerramos conexion
mysql_close($conexion);
 
?>    Resumiendo: quiero q cuando escriba un nombre en el text, y le de enviar, lo mande a la otra pagina de php, y ahi pueda hacer la bsuqueda, y en la pagina donde esta el text (abajo), mostrar el resultado.
 
