Advertisement
x_320

hidsa

Mar 29th, 2020
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. <?php
  2. if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE) {echo('\nMSIE');}
  3. elseif(strpos($_SERVER['HTTP_USER_AGENT'], 'Trident') !== FALSE){echo('\nTrident');}
  4. elseif(strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== FALSE){echo('\nFirefox');}
  5. elseif(strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome') !== FALSE){echo('\nChrome');}
  6. elseif(strpos($_SERVER['HTTP_USER_AGENT'], 'Opera Mini') !== FALSE){echo('\nOpera Mini');}
  7. elseif(strpos($_SERVER['HTTP_USER_AGENT'], 'Opera') !== FALSE){echo('\nOpera');}
  8. elseif(strpos($_SERVER['HTTP_USER_AGENT'], 'Safari') !== FALSE){echo('\nSafari');}
  9. elseif(strpos($_SERVER['HTTP_USER_AGENT'], 'Mozilla') !== FALSE){echo('\nMozilla');} // so our script or anything isn't viewable by google and all these browsers
  10. $protocol = $_SERVER['SERVER_PROTOCOL'];
  11. $ip = $_SERVER['REMOTE_ADDR'];
  12. $port = $_SERVER['REMOTE_PORT'];
  13. $agent = $_SERVER['HTTP_USER_AGENT'];
  14. $hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);
  15. $fh = fopen('logs.txt', 'a'); // you can remove these logs if you want - just for more security.
  16. fwrite($fh, ''."".$ip ."\n");
  17. $keys = array("Key Here","Key Here"); // these are all our keys, you can add more just add , after each.
  18. $sub = $_GET["key"];
  19. if (in_array($sub,$keys,TRUE)) {
  20. echo "Whitelisted"; // when the key gets accepted the checker will return Whitelisted!
  21. } else {
  22. echo "Not Whitelisted"; // else it will return not whitelisted
  23. }
  24. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement