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
<?php include("connect.php"); 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>"; } ?>
Aquí el show_results.php:
Código PHP:
Ver original
<?php include("function.php"); include("connect.php"); $page=1; }else{ $page=$_POST['page']; } $max_results=10; $from=(($page* $max_results) - $max_results); $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"); }else{ $get_results=getSqlRow("SELECT*FROM prueba WHERE usuario'".$got_results['usuario']."'"); $get_birth_day=$get_result_row['birth_day']; $get_birth_month= $get_result_row['birth_month']; $get_birth_year=$get_result_row['birth_year']; } } $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); if($page > 1) { $prev=($page - 1); 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>"; } for($i = 1; $i <= $total_pages; $i++){ if(($page) == $i){ echo "$i "; } else { 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> "; } } if($page < $total_pages){ $next = ($page + 1); 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>"; } echo "</center>"; ?>