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

02-08-2010, 01: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?

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

02-08-2010, 03: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?

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


Is there a way around this?