Ver Mensaje Individual
  #1 (permalink)  
Antiguo 10/04/2010, 07:12
den_22
 
Fecha de Ingreso: enero-2010
Mensajes: 198
Antigüedad: 14 años, 3 meses
Puntos: 1
Haciendo el buscador(problemas)

Hola nuevamente, a todos, verán sigo con el tema del buscador, haciendolo de nuevo; el tema es que al apretar en search, sigue sin buscar nada, o sea se quedan en blanco los campos donde deberían aparecer cosas de la bd.

Les muestro el código que tengo hasta ahora, y ustedes me dirán que estoy haciendo mal, si me he olvidado algo, o si por ahi me olvidé de declarar algo.

Gracias de antemano.

Aqui el search.php:

Código PHP:
Ver original
  1. <?php
  2. error_reporting(E_ALL ^ E_NOTICE);
  3. session_name('pLogin');
  4.  
  5.  
  6. include("connect.php");
  7.  
  8. if (isset($_POST['search'])){
  9. $search_number = rand(1000000000,9999999999);
  10. echo "<script>document.location.href='show_results.php?search=".$search_number."&&firstname=".$_POST['firstname']."&&sexo=".$_POST['gender']."&&relationsearch=".$_POST['iwanted']."&&pais=".$_POST['pais']."&&estadocivil=".$_POST['estadocivil']."'</script>";
  11. }
  12.  
  13.  
  14.  
  15.  
  16. ?>


Aquí el show_results.php:

Código PHP:
Ver original
  1. <?php
  2.  
  3. error_reporting(E_ALL ^ E_NOTICE);
  4.  
  5. session_name('pLogin');
  6. include("function.php");
  7. include("connect.php");
  8.  
  9.  
  10. if(!isset($_POST['page'])){
  11.     $page=1;
  12.     }else{
  13.     $page=$_POST['page'];
  14.     }
  15.     $max_results=10;
  16.     $from=(($page* $max_results) - $max_results);
  17.    
  18.     $get_results=mysql_query("SELECT * FROM prueba WHERE firstname='".$_POST['firstname']."' AND sexo='".$_POST['gender']."' AND relationsearch='".$_POST['iwanted']."' AND pais='".$_POST['pais']."' AND estadocivil='".$_POST['estadocivil']."'  LIMIT $from, $max_results");
  19.    
  20.     if(mysql_num_rows($get_results)==0){
  21.        
  22.     }else{
  23.        
  24.         while($got_results=mysql_fetch_array($get_results)){
  25.             $get_results=getSqlRow("SELECT*FROM prueba WHERE usuario'".$got_results['usuario']."'");
  26.             $get_birth_day=$get_result_row['birth_day'];
  27.             $get_birth_month= $get_result_row['birth_month'];
  28.             $get_birth_year=$get_result_row['birth_year'];
  29.            
  30.            
  31.         }
  32. }
  33.  
  34. $total_results=mysql_result(mysql_query("SELECT COUNT(*) as Num FROM prueba WHERE firstname='".$_POST['firstname']."' AND sexo='".$_POST['gender']."' AND relationsearch='".$_POST['iwanted']."' AND pais='".$_POST['pais']."' AND estadocivil='".$_POST['estadocivil']."'"),0);
  35. $total_pages=ceil($total_results / $max_results);
  36.  
  37. if($page > 1) {
  38.     $prev=($page - 1);
  39.     echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$prev&&firstname=".$_POST['firstname']."&&sexo=".$_POST['gender']."&&relationsearch=".$_POST['iwanted']."&&pais=".$_POST['pais']."&&estadocivil=".$_POST['estadocivil']."\" class=\"title_text\">Anterior</a>";
  40.             }
  41.            
  42.             for($i = 1; $i <= $total_pages; $i++){
  43.             if(($page) == $i){
  44.             echo "$i ";
  45.             } else {
  46.             echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$i&&firstname=".$_POST['firstname']."&&sexo=".$_POST['gender']."&&relationsearch=".$_POST['iwanted']."&&pais=".$_POST['pais']."&&estadocivil=".$_POST['estadocivil']."\" class=\"title_text\">$i</a> ";
  47.             }
  48.             }
  49.            
  50.             if($page < $total_pages){
  51.             $next = ($page + 1);
  52.             echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$next&&firstname=".$_POST['firstname']."&&sexo=".$_POST['gender']."&&relationsearch=".$_POST['iwanted']."&&pais=".$_POST['pais']."&&estadocivil=".$_POST['estadocivil']."\" class=\"title_text\">Siguiente</a>";
  53.             }
  54.             echo "</center>";
  55.  
  56.  
  57.  
  58. ?>