routeSQL : set cookies to store the search, number of elements and page

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2008 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2015-03-11 15:28:13 +00:00
parent 54861413e0
commit f9ce6e2483

View File

@@ -238,6 +238,9 @@ class routeSQL
// num is the number of elements displayed by page
// page is the page to display
// Allow the parameters to be sent in any order
if (isset ($_COOKIE["num"])) $num = $_COOKIE["num"];
if (isset ($_COOKIE["page"])) $page = $_COOKIE["page"];
if (isset ($_COOKIE["search"])) $search = $_COOKIE["search"];
if ($p1 === "num") $num = $v1;
if ($p2 === "num") $num = $v2;
if ($p3 === "num") $num = $v3;
@@ -253,6 +256,10 @@ class routeSQL
$page = intval ($page);
$num = intval ($num);
$search = rawurldecode ($search);
$url = "/".$this->url_prefix;
setcookie ("page", "$page", time()+3600*24*30);
setcookie ("num", "$num", time()+3600*24*30);
setcookie ("search", "$search", time()+3600*24*30);
//echo "PAGE=$page\n";
//echo "NUM=$num\n";
//echo "SEARCH=$search\n";