PageRenderTime 41ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/server/vpn.51sync.com/env.php

https://github.com/qibinghua/vpn.51sync
PHP | 20 lines | 18 code | 1 blank | 1 comment | 6 complexity | 613c7eb6901c8d5f48e41a30299ff9df MD5 | raw file
Possible License(s): BSD-3-Clause
  1. <?php
  2. echo '182.237.0.18';
  3. function getOnlineIp () {
  4. // 获得IP地址
  5. if (getenv('HTTP_CLIENT_IP') && strcasecmp(getenv('HTTP_CLIENT_IP'), 'unknown')) {
  6. $onlineip = getenv('HTTP_CLIENT_IP');
  7. } elseif (getenv('HTTP_X_FORWARDED_FOR') && strcasecmp(getenv('HTTP_X_FORWARDED_FOR'), 'unknown')) {
  8. $onlineip = getenv('HTTP_X_FORWARDED_FOR');
  9. } elseif (getenv('REMOTE_ADDR') && strcasecmp(getenv('REMOTE_ADDR'), 'unknown')) {
  10. $onlineip = getenv('REMOTE_ADDR');
  11. } elseif (isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] && strcasecmp($_SERVER['REMOTE_ADDR'], 'unknown')) {
  12. $onlineip = $_SERVER['REMOTE_ADDR'];
  13. }
  14. $onlineip = addslashes($onlineip);
  15. @preg_match('/[\d\.]{7,15}/', $onlineip, $onlineipmatches);
  16. $onlineip = $onlineipmatches[0] ? $onlineipmatches[0] : 'unknown';
  17. unset($onlineipmatches);
  18. return $onlineip;
  19. }