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
Try this:
if (strpos($_SERVER['REQUEST_URI'], '?') !== false)
{
$url = $_SERVER['REQUEST_URI'] . '&var=value';
}
else
{
$url = $_SERVER['REQUEST_URI'] . '?var=value';
}
<a href="<php echo $url;>">Go</a>
Note that $_SERVER['REQUEST_URI']
gives you current url including query string value.
$query_string = http_build_query(array_merge($_GET, array('page' => $page)));