Use $_SERVER instead of filter_input.

On some server the filter_input method was returning NULL.