in reply to question about code

That long if statement is true when the server name (or whatever is in $Request->ServerVariables("SERVER_NAME")->item()) neither begins with 'www' or 'mlx' nor is 'localhost'

If that is the case, it extracts the letters until the first '.' of the server name. For example if the server name is sef.mlxhelp.com, that would be 'sef'.>p> Then it constructs the html code   <inputH name="site" value="sef"/> out of it.

If the long if statement is false, the rest of the code is executed. That code seems to construct a list of sites, where you can select one.

Others with more experience with web coding will probably see much more.

But I would suggest giving some more details. Why do you suspect $request->servervariables("SERVER_NAME") is undefinded? Which modules are used? Do you get any errors? What does the server log say?