Add a set of querystring params to a URL
Your code is very spaced out. It doesn't need to be.
Consider using industry-standard style by using Egyptian braces for control structures like if and foreach.
Get rid of the $http_host variable; you never use it.
Consider generalising your function to accept any URL instead of pulling REQUEST_URI.
You're kind of reinventing the wheel; PHP has the built-in functions parse_str and http_build_query that you can use.
Do you intend to replace existing variables, or just to append them to the request?


Here's an example that takes advantage of the built-in functions, and intelligently merges in conflicts. (ideone)

/**
 *  Like array_merge, but will recursively merge array values.
 *
 *  @param array $a1
 *      The array to be merged into.
 *  @param array $a2
 *      The array to merge in. Overwrites $a1, when string keys conflict.
 *      Numeric keys will just be appended.
 *  @return array
 *      The array, post-merge.
 */
function merge_query_var_arrays($a1, $a2) {
    foreach ($a2 as $k2 =&gt; $v2)
        if (is_string($k2))
            $a1[$k2] = isset($a1[$k2]) &amp;&amp; is_array($v2) ? merge_query_var_arrays($a1[$k2], $v2) : $v2;
        else
            $a1[] = $v2;
    return $a1;
}

/**
 *  @param string $query_string
 *      The URL or query string to add to.
 *  @param string|array $vars_to_add
 *      Either a string in var=val&amp;[...] format, or an array.
 *  @return string
 *      The new query string. Duplicate vars are overwritten.
 */
function add_query_vars($query_string, $vars_to_add) {
    if (is_string($vars_to_add))
        parse_str($vars_to_add, $vars_to_add);
    if (preg_match('/.*\?/', $query_string, $match))
        $query_string = preg_replace('/.*\?/', '', $query_string);
    parse_str($query_string, $query_vars);

    $query_vars = merge_query_var_arrays($query_vars, $vars_to_add);
    return @$match[0] . http_build_query($query_vars);
}