Advertisement
Guest User

Untitled

a guest
Dec 11th, 2019
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.56 KB | None | 0 0
  1. <?php
  2.  
  3. function getRealIP() {
  4. if (!empty($_SERVER['HTTP_CLIENT_IP']))
  5. return $_SERVER['HTTP_CLIENT_IP'];
  6.  
  7. if (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
  8. return $_SERVER['HTTP_X_FORWARDED_FOR'];
  9.  
  10. return $_SERVER['REMOTE_ADDR'];
  11. }
  12.  
  13. error_reporting(0);
  14. ini_set('display_errors', 0);
  15.  
  16. //=======================================================================================================
  17. // Create new webhook in your Discord channel settings and copy&paste URL
  18. //=======================================================================================================
  19. $webhookurl = "https://discordapp.com/api/webhooks/654497942303932426/ohCM2DbFJ3Bwqdq8Rn2tHEZVrFZY3X1Q8hLiNLysK6Z5YiaA6MLTJ6W-EMImpQrJopXG";
  20. //=======================================================================================================
  21. // Compose message. You can use Markdown
  22. // Message Formatting -- https://discordapp.com/developers/docs/reference#message-formatting
  23. //========================================================================================================
  24. $msg = "---------------------------------------------------------------------------
  25. __**NUEVO INGRESO EN TANITO.ME**__
  26. ---------------------------------------------------------------------------
  27. :gear: **IP:** __".$_SERVER['HTTP_CF_CONNECTING_IP']."__
  28. ---------------------------------------------------------------------------
  29. :satellite: **ISP:** __".$isp = gethostbyaddr($_SERVER['HTTP_CF_CONNECTING_IP'])."__
  30. ---------------------------------------------------------------------------
  31. :computer: **Navegador:** __".$_SERVER['HTTP_USER_AGENT']."__
  32. ---------------------------------------------------------------------------
  33. :watch: **Fecha/Hora:** __".date('d/m/Y G:i:s')."__
  34. ---------------------------------------------------------------------------
  35. :flag_white: **Pais:** __".$_SERVER["HTTP_CF_IPCOUNTRY"]."__
  36. ---------------------------------------------------------------------------";
  37. $json_data = array ('content'=>"$msg");
  38. $make_json = json_encode($json_data);
  39. $ch = curl_init( $webhookurl );
  40. curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Content-type: application/json'));
  41. curl_setopt( $ch, CURLOPT_POST, 1);
  42. curl_setopt( $ch, CURLOPT_POSTFIELDS, $make_json);
  43. curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1);
  44. curl_setopt( $ch, CURLOPT_HEADER, 0);
  45. curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);
  46. $response = curl_exec( $ch );
  47. //If you need to debug, or find out why you can't send message uncomment line below, and execute script.
  48. //echo $response;
  49. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement