Hi guys,
Running 1.6.8 build 20090723
I need to do a custom search - enter a postcode and a distance and get the results within that area.
The PHP code I am using generate a list of entry ids that match the criteria, which I then parse into a {exp:weblog:entries} tag.
This works fine until I use pagination and the posted variables used in the query are lost.
Is there a way to store either the posted variables or the query results so they can be used through pagination?
Thanks.
Edit: I did get it working with Cookie Plus and embeds, but because of the parse order, the results were always a search behind.
[Mod Edit: Moved to the Development and Programming forum]
Thanks John.
I don’t think SuperSearch will be for us.
I would really appreciate some help getting to grips with the best way of getting the Cookies to update on page load.
Simplified code below:
<?
if ($IN->GBL('txt_postcode', 'POST')) {
// code to work out the entry ids...
// ...
$ids = '1,2,3,4,5,6';
echo '{exp:cookie_plus:set name="cookiename" value="'.$ids.'" seconds="3600"}';
}
?>
<!DOCTYPE....
<form method="post">
<input type="text" name="txt_postcode" value="la2" />
<input type="submit" name="submit" />
</form>
{exp:cookie_plus:get name="cookiename"}In this template I obviously have PHP enabled and am parsing on input. If I click on submit, the Cookie is not updated. If I click on submit again, the Cookie is updated with the last submitted information.
For example, if I submit a postcode value of LA2, nothing is returned as the cookie value. If I then submit a postcode value of BB1, LA2 is returned as the cookie value.
How can I make sure that when LA2 is submitted, the cookie value is immediately updated?
Thanks!
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.