Ajax I execute a simple script:
<?php require_once "connection.php"; $id = trim($_REQUEST["id"]); $link = mysqli_connect($host, $user, $password, $database) or die("Ошибка " . mysqli_error($link)); $query = "SELECT A.car_numb, A.ttn, A.cargo, A.weight, T.telega_token, T.telega_chat_id FROM accounting_entry AS A LEFT JOIN contragents AS T ON (A.id_to = T.id_contr) WHERE id=" . $id; $result = mysqli_query($link, $query) or die("Ошибка " . mysqli_error($link)); if ($result) $row_rec = mysqli_fetch_array($result); $token = $row_rec[4]; $chat_id = $row_rec[5]; $txt = $row_rec[0]."%2F".$row_rec[1]."\r\n".$row_rec[2]."\n".$row_rec[3]; $sendToTelegram = fopen("https://api.telegram.org/bot{$token}/sendMessage?chat_id={$chat_id}&parse_mode=html&text={$txt}","r"); if($sendToTelegram){ echo "Запись №".$id." отправлена."; } else { echo "Чет сломалось и не отправляется."; } ?>
The result in the message looks like this: AA8827TM / 539138__Popcorne / n24200 Help me move the string.