Jump to content

How can I replace the value of a GET var in the URL


cooldude832

Recommended Posts

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?

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.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.