diff --git a/routeSQL.php b/routeSQL.php index 248c0f1..40daed0 100644 --- a/routeSQL.php +++ b/routeSQL.php @@ -144,12 +144,17 @@ class routeSQL $route->redirect ("/".$this->url_prefix, ""); }); - $route->get ($this->url_prefix."(\?(page={page})?&?(num={num})?)?", - function ($page, $num) use ($route) + $route->get ($this->url_prefix."(\?({p1}={v1})(&{p2}={v2})?)?", + function ($p1, $v1, $p2, $v2) use ($route) { // LIST ALL THE OBJECTS OF THE TABLE // 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 ($p1 === "num") $num = $v1; + if ($p2 === "num") $num = $v2; + if ($p1 === "page") $page = $v1; + if ($p2 === "page") $page = $v2; $this->connect(); $csrf = new csrf (); $token = $csrf->createToken ();