Ver Mensaje Individual
  #6 (permalink)  
Antiguo 02/04/2010, 17:08
den_22
 
Fecha de Ingreso: enero-2010
Mensajes: 198
Antigüedad: 14 años, 3 meses
Puntos: 1
Respuesta: haciendo un buscador

Hola hasta el momento tengo hecho esto:

el search.php:

Código PHP:
Ver original
  1. <?  error_reporting(E_ALL ^ E_NOTICE);
  2. session_name('pLogin');
  3.  
  4. include("function.php");
  5. include("connect.php");
  6. include("getdata.php");
  7.  
  8. $query = mysql_query("select * from prueba where usuario='$usuario'");
  9.    $getname = mysql_fetch_array($query);
  10.    $firstname = $getname["firstname"];
  11.    $lastname =$getname["lastname"];
  12.    $gender= $getname["sexo"];
  13.    $estadocivil=$getname["estadocivil"];
  14.    $pais=$getname["pais"];
  15.  <?

y el html va dentro de un form que tiene un action="show_results.php"

que aqui está:

Código PHP:
Ver original
  1. <?error_reporting(E_ALL ^ E_NOTICE);
  2.  
  3. session_name('pLogin');
  4. include('connect.php');
  5. $usuario = $_SESSION['usuario'];
  6.  
  7. $firstname=$_POST['firstname'];
  8. $lastname=$_POST['lastname'];
  9. $estadocivil=$_POST['estadocivil'];
  10.  
  11.  
  12. mysql_query("select * from prueba where firstname='".$firstname."',lastname='".$lastname."',estadocivil='".$estadocivil."', pais='".$pais."'");
  13.     ?>

y el html contiene un <?php echo $estadocivil;?> por ejemplo.

Pero hasta ahora no conseguí que haga la búsqueda.

Alguien tiene alguna idea?