Advertisement
DenisMagic

В чём гребаная ошибка

Jun 14th, 2021
897
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.02 KB | None | 0 0
  1. if (mb_stripos($text, '/pars') !== false) {
  2.         sendTelegram(
  3.             'sendMessage',
  4.             array(
  5.                 'chat_id' => TELEGRAM_CHATID,
  6.                 'text' => 'Введите сайт для проверки на базу:'
  7.             )
  8.         );
  9.         if (!empty($data['message']['text']))
  10.         {
  11.             $site = $data['message']['text'];
  12.             $ch = curl_init($site);
  13.             curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  14.             curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  15.             curl_setopt($ch, CURLOPT_HEADER, false);
  16.             $html = curl_exec($ch);
  17.             curl_close($ch);
  18.             echo $html; // Выведет код страницы
  19.             $log = fopen("result.txt","at");
  20.             fwrite($log,"$html");
  21.             fclose($log);
  22.             sendTelegram(
  23.             'sendMessage',
  24.             array(
  25.                 'chat_id' => TELEGRAM_CHATID,
  26.                 'text' => $html
  27.             )
  28.         );
  29.         }
  30.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement