Replaced http_response_code() since it's only available in PHP >= 5.4.0.