I have some database information that is being shown on a page.
I am using a pagination class that uses the $_GET[\'page\'] variable in the url. When you c
$_GET[\'page\']
Try this:
if (strpos($_SERVER['REQUEST_URI'], '?') !== false) { $url = $_SERVER['REQUEST_URI'] . '&var=value'; } else { $url = $_SERVER['REQUEST_URI'] . '?var=value'; } Go
Note that $_SERVER['REQUEST_URI'] gives you current url including query string value.
$_SERVER['REQUEST_URI']