It looks like you are using an older version of PHP. In the version I have undefined variables are treated as either 0 (zero) or ’’ (empty, nul). so the line if($site_name_in)would not cause a problem and be understood as false unless the variable had been assigned via the URL (get) or a form field (post).
$GLOBALS[SERVER_NAME]) and $GLOBALS[REDIRECT_URL]) are system variables and would therefore already be defined.
I’m using PHP 4.05 on my home computer and 4.3.6 on the web host phpBible.org is located on. The following code in a php script will tell you the version (among quite a bit of other stuff)
// Show all information, defaults to INFO_ALL
// Show just the module information.
// phpinfo(8) yields identical results.