echo setQSparam ('page', 2);
function setQSparam ($var, $value) {
$qsParams = array();
$url = parse_url($_SERVER['REQUEST_URI']);
if (!$url['query'])
return $url['path'];
parse_str( $url['query'], $qsParams );
extract($qsParams, EXTR_SKIP);
if (isset($_GET[$var]))
$_GET[$var] = $value;
return $url['path'] . "?" . http_build_query($_GET, '', '&');
}