Page 1 of 1

pagination previous and next links to retrieve from form

Posted: Thu Sep 01, 2005 7:02 am
by Simplecat
Hi

I have been having trouble using pagination to display user searches from a form. The user can enter search parameters with the following three criteria: pricerange, location and property_type from drop down menu's on a html page. when submitted these are sent to a php page. The first page of results is OK, showing the required results, but when using the next and previoius links the results seem to be unfiltered. Seems that the pagination script loses the original search criteria. and just scrolls through the table. I know the script is basically OK

Could anyone tell me if the below code snippet used for printing out the previous link would rectify this


if($page > 1){
$prev = ($page - 1);

echo '<a href="'.$_SERVER['PHP_SELF'].'?page=' .$prev. '&pricerange='.$_GET['pricerange'].'&location='.$_GET['location'].'&property_type='.$_GET['property_type'].'">prev</a>';

}

Am getting desparate now... this pagination thing is a bugger

Cheers

Simplecat

Posted: Thu Sep 01, 2005 8:23 am
by JAM
Not enough code to say. As the user is using a <form> it could aswell be using the $_POST way of retreiving data.... It looks allright though if it's indeed using the $_GET and URI way of shipping formdata.