lukep11a Posted January 24, 2011 Share Posted January 24, 2011 Hi, I have search form which works apart from 1 part, I have set the results limit to 10 per page with a next link if there are more than 10 results, however when the next link is clicked, i get the error 'you do not have a search parameter' which comes from this code: if (!isset($var)) { echo "<p>We dont seem to have a search parameter!</p>"; exit; } The next link is defined by the code below: // check to see if last page if (!((($s+$limit)/$limit)==$pages) && $pages!=1) { // not last page so give NEXT link $news=$s+$limit; echo " <a href=\"$PHP_SELF?s=$news&q=$var\">Next 10 >></a>"; } Can anyone see where I have gone wrong with this code without me sending the whole search form? Any help would be very much appreciated. Thanks Quote Link to comment Share on other sites More sharing options...
codefossa Posted January 24, 2011 Share Posted January 24, 2011 if (!((($s+$limit)/$limit)==$pages) && $pages!=1) { would be if ((($s + $limit) / $limit) != $pages && $pages != 1) { Quote Link to comment Share on other sites More sharing options...
lukep11a Posted January 24, 2011 Author Share Posted January 24, 2011 thanks, i have tried that and it has the same result Quote Link to comment Share on other sites More sharing options...
codefossa Posted January 24, 2011 Share Posted January 24, 2011 thanks, i have tried that and it has the same result Sorry, I stopped at the first problem I saw. echo " <a href=\"$PHP_SELF?s=$news&q=$var\">Next 10 >></a>"; try instead echo '$nbsp;<a href="' . $PHP_SELF . '?s=' . $news . '&q=' . $var . '">Next 10 >></a>'; Quote Link to comment Share on other sites More sharing options...
lukep11a Posted January 24, 2011 Author Share Posted January 24, 2011 No problem, thanks for keep trying for me but it's still not working, it just keeps saying We dont seem to have a search parameter! when I click next Quote Link to comment Share on other sites More sharing options...
lukep11a Posted January 24, 2011 Author Share Posted January 24, 2011 Thanks for your help, I've managed to sort it... I think! I've just removed the first part and seems to be working.. if (!isset($var)) { echo "<p>We dont seem to have a search parameter!</p>"; exit; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.