cooldude832 Posted May 17, 2007 Share Posted May 17, 2007 I'm trying to create a search result page. with the url that has someone.com/serach.php?critera1=sometihg&critera2=something&limit=0 Limit is what sets which part of the matching results it will display. This script works great if I manually set limit by using my mouse in the url and changing it to 1,2,3,4,5,etc etc, but I want to change it dynamically so that I can say: previous 1 2 3 4 5 6 7 8 9 10 next and those be links to pages where Limit is equal to what ever number they are. Is there a simple way to change limit with out having to explode the url string apart chopping it down to just limit=n or limit=nn and then chop limit=n/limit=nn at the = and implode the whole url back together? Quote Link to comment Share on other sites More sharing options...
soycharliente Posted May 17, 2007 Share Posted May 17, 2007 Your question confuses me a little bit. Can you provide a more detailed explanation? Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted May 17, 2007 Author Share Posted May 17, 2007 http://www.me.org/horse/search.php?search=yes&state=&breed=Appaloosa&sex=&orf=&limit=0 that is my url, but i think I got a simple solution i'm going to try this $urlexplode = explode('&limit=',$url); $limit = $urlexplode[1]; $url = $urlexplode[0]; as long as someone don't mess with my url. Quote Link to comment Share on other sites More sharing options...
hitman6003 Posted May 17, 2007 Share Posted May 17, 2007 all of those variables, and their values, are available in the $_GET superglobal array. Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted May 17, 2007 Author Share Posted May 17, 2007 I know that , but my issue is not retriving its value, but replacing its value in a new url if i'm on http://www.me.org/horse/search.php?search=yes&state=&breed=Appaloosa&sex=&orf=&limit=0 i want to have a link to http://www.me.org/horse/search.php?search=yes&state=&breed=Appaloosa&sex=&orf=&limit=1 http://www.me.org/horse/search.php?search=yes&state=&breed=Appaloosa&sex=&orf=&limit=2 http://www.me.org/horse/search.php?search=yes&state=&breed=Appaloosa&sex=&orf=&limit=3 etc. Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted May 17, 2007 Share Posted May 17, 2007 Take a look at the function http_build_query(). I think it will help you solve your problem. Ken 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.