Pager and Cookies

From: Date: Wed, 26 Jan 2005 22:54:03 +0000
Subject: Pager and Cookies
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-17193@lists.php.net to get a copy of this message
I am implementing cookies with my paged application so that I can come back to the list without loosing my place. Basically the page number is stored in the cookie. However I am experiencing some strange results. My application is working fine as I page through the results, however the list of pages is showing that I am on the previous page (obviously because I have a cookie with the same name as the page variable). Is their a way that I can specify the page I am on instead of pager determining this for me with the $_REQUEST variable, or can the pager code be modified as to not use the $_REQUEST variable but to use the following if statement? if (isset($_POST[$pageId])) {
    ...
} elseif (isset($_GET[$pageId])) {
    ...
} elseif (isset($_COOKIE[$pageId])) {
    ...
} This will allow the use of cookies in conjunction with either a GET or POST page value. Is this the best way, or am I missing something? Thanks Andrew

« previous php.pear.general (#17193) next »