...

View Full Version : Append parameters (offset) to URL?



htcilt
02-08-2010, 12:08 PM
I currently working on pagination for my search results page.
I'm trying to figure out how to append the generated offset to the URL

I need to somehow gather the existing URL and add the offet to the end.
However there are other complications like if offet already exists in the URL and whether a "?" or "&" is required.

Does a function in PHP exist to handle this?

abduraooft
02-08-2010, 12:20 PM
Take a look at http_build_query() (http://php.net/http_build_query)

htcilt
02-08-2010, 02:05 PM
Thanks abduraooft.
Looking at the info I planned to do the following:

1) $_GET each each parameter and store into separate variables
2) Do the escapes and validation on each
3) put into http_build_query()

Does the above sound correct?

htcilt
02-08-2010, 03:48 PM
My initial problem with http_build_query() is that I'm passing checkbox arrays so I'm getting:


http://mysite/results.php?keyword=hello&form=Submit&Param1=Arrayoffset=20

Is there a way around this?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum