Hello,
I have built search and results page, but results lose filter after first page.
Example: If I search for "Smith", the correct count of found Smiths is shown (39) but only the first 15 results are "Smith" while when I click on the next page, it shows results which have nothing to do with "Smith".
Here is the code for the results page:
<?php require_once('Connections/skajclients.php'); ?>
<?php
$currentPage = $_SERVER["PHP_SELF"];
?>
<?php require_once('Connections/skajclients.php'); ?>
<?php
// Navigation
$maxRows_Recordset1 = 15;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
mysql_select_db($database_skajclients, $skajclients);
$query_Recordset1 = "SELECT * FROM users WHERE users.emri LIKE '".$_POST["Keywords"]."%' OR users.rruga LIKE '".$_POST["Keywords"]."%' OR users.mbiemri LIKE '".$_POST["Keywords"]."%' OR users.link_me_kodet LIKE '".$_POST["Keywords"]."%' OR users.karta LIKE '".$_POST["Keywords"]."%' OR users.vendi LIKE '".$_POST["Keywords"]."%'";
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $skajclients) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
if (isset($_GET['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
$all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
$queryString_Recordset1 = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_Recordset1") == false &&
stristr($param, "totalRows_Recordset1") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_Recordset1 = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s", $totalRows_Recordset1, $queryString_Recordset1);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" c />
<title>Untitled Document</title>
<style type="text/css">
<!--
rowline {
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-bottom-style: dashed;
border-top-color: #990000;
border-right-color: #990000;
border-bottom-color: #990000;
border-left-color: #990000;
}
.style3 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; font-weight: b