well someone can potentially pass their own HTTP_REFERER variable with a GET, COOKIE, or POST variable, but I don't really think it'll get overwritten.
I don't see how getenv would possibly work at all, as that's only supposed to grab shell variables. Actually, it looks like I've misunderstood the getenv() function, it gets php Environmental variables, talk about confusing.
I'd still use the $SERVER[] method over calling a separate function, since the SERVER variable is already there.