$query = $_GET; // replace parameter(s) $query['d'] = 'new_value'; // rebuild url $query_result = http_build_query($query); // new link <a href="<?php echo $_SERVER['PHP_SELF']; ?>?<?php echo $query_result; ?>">Link</a>