-4

Notice: Undefined variable: SERVER in C:\plusmaster.ir\www\remauthnew2.php on line 12

Notice: Undefined variable: SERVER in C:\plusmaster.ir\www\remauthnew2.php on line 12

Notice: Undefined variable: SERVER in C:\plusmaster.ir\www\remauthnew2.php on line 17

Notice: Undefined variable: SERVER in C:\plusmaster.ir\www\remauthnew2.php on line 17

Notice: Undefined variable: SERVER in C:\plusmaster.ir\www\remauthnew2.php on line 25

Notice: Undefined variable: SERVER in C:\plusmaster.ir\www\remauthnew2.php on line 25

 // standard phpBB setup
 if($SERVER['REMOTE_ADDR'] == "127.0.0.1" || $SERVER['REMOTE_ADDR'] == "75.43.188.87")
 {
        unset($SERVER['REMOTE_ADDR']);
        $SERVER['REMOTE_ADDR'] = $SERVER['HTTP_X_REAL_IP'];
 }
 if($SERVER['HTTP_X_FORWARDED_FOR'] == "127.0.0.1" || $SERVER['HTTP_X_FORWARDED_FOR'] == "75.43.188.87")
 {
        unset($SERVER['HTTP_X_FORWARDED_FOR']);
 }
 function get_ip_address() {
    foreach (array('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR') as $key) {
        if (array_key_exists($key, $_SERVER) === true) {
            foreach (explode(',', $_SERVER[$key]) as $ip) {
                if($SERVER[$key] == "127.0.0.1" || $SERVER[$key] == "75.43.188.87")
                {
                        unset($_SERVER[$key]);
                }
                if (valid_ip($ip) !== false) {
                    return $ip;
                }
            }
        }
    }
 }
user3821511
  • 1
  • 1
  • 1

2 Answers2

1

The variable name is $_SERVER.

http://php.net/manual/en/reserved.variables.server.php

Andy Lester
  • 91,102
  • 13
  • 100
  • 152
1

This is a typo problem: the global variable's name is $_SERVER, not $SERVER. See the docs.

elixenide
  • 44,308
  • 16
  • 74
  • 100