Guest User

remote

a guest
Apr 28th, 2016
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. <?php
  2. define('DIRECT', TRUE);
  3. function getRealIpAddr()
  4. {
  5. if (!empty($_SERVER['HTTP_CF_CONNECTING_IP']))
  6. {
  7. $ip = $_SERVER['HTTP_CF_CONNECTING_IP'];
  8. }
  9. else if (!empty($_SERVER['HTTP_CLIENT_IP'])) //check ip from share internet
  10. {
  11. $ip=$_SERVER['HTTP_CLIENT_IP'];
  12. }
  13. elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) //to check ip is pass from proxy
  14. {
  15. $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
  16. }
  17. else
  18. {
  19. $ip=$_SERVER['REMOTE_ADDR'];
  20. }
  21. return $ip;
  22. }
  23. $_SERVER['REMOTE_ADDR'] = getRealIpAddr();
  24. require 'functions.php';
  25. $user = new user;
  26. $stats = new stats;
  27. $url = 'http://localhost';
  28. ?>
Advertisement
Add Comment
Please, Sign In to add comment