CaFc_Br40ck

Untitled

Sep 11th, 2025
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. <?php
  2. function getUserIP() {
  3. if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
  4. $ip = $_SERVER['HTTP_CLIENT_IP'];
  5. } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
  6. $ip = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR'])[0];
  7. } else {
  8. $ip = $_SERVER['REMOTE_ADDR'];
  9. }
  10. return $ip;
  11. }
  12.  
  13. $ip = getUserIP();
  14. $api_url = "http://ip-api.com/json/{$ip}";
  15. $response = file_get_contents($api_url);
  16. $data = json_decode($response, true);
  17.  
  18. if ($data['countryCode'] === 'ID' || $data['countryCode'] === 'US') {
  19. ob_start();
  20. include 'readme.html';
  21. $output = ob_get_clean();
  22. echo $output;
  23. exit();
  24. }
Advertisement
Add Comment
Please, Sign In to add comment