Search the Community
Showing results for tags 'pagination search form'.
-
Hi guys, having a small issue and I know how helpful you lot can be so I thought I would chance my arm again! I have a search form on my home page in which the user selects a country and the hotels from that country are displayed on the search page. This is my code: <?php if( isset($_POST['mysearchlocation']) ) { $country = $pages->find("template=hotel, hotel_country=$country, limit=3"); $pagination = $country->renderPager(); foreach($country as $resort) { echo "<li class='result-item star$resort->star_rating'>"; $firstimage = $resort->images->first(); echo "<img src='$firstimage->url'>"; echo "<div class='result_panel'><a>"; if ($resort->favourite) { echo "<h2 class='flagged'>$resort->hotel_name</h2><p>"; } else { echo "<h2>$resort->hotel_name</h2><p>"; } //get area & country name $parents = $resort->parents->slice(2); foreach($parents as $parent) { echo "<a href='$parent->url'>$parent->title</a>,"; } echo "</p></a>"; echo "<img class='star_rating' src='../img/icons/stars_$resort->star_rating.png' >"; echo $resort->hotel_facilities; echo "</div>"; echo "<a class='btn more_info_btn' href='$resort->url'>More info<span class='icon'> ></span></a>"; echo "</li>"; } } echo $pagination; ?> the issue that I am having is that when I select the next page of results, for example page 2, my post variable is obviously lost. Has anyone any ideas on how to work around this because I'm drawing a blank at the moment! Any help would be greatly appreciated, Jamie