server variables as in $_SERVER[] are very helpful in building scripts which run on different servers.
instead of hardcoding variables these might do the trick

this snippet will produce a list of all available server variables

download options for information / server variables

you can download the source as PHP file,

open the file as plain text in a new window or

get the code in a textarea to copy it.