<?php
//функция для генерации кода для sms
function generateSmsID($length = 8) {
$chars = '0123456789';
$string = '';
for ($i = 0; $i < $length; $i++) {
$string .= substr($chars, rand(1, $numChars) - 1, 1); }
return $string;
}
$tel = filter_input(INPUT_POST
, 'phone', FILTER_SANITIZE_SPECIAL_CHARS
); //$sessionID= generateSessionID(32);
$login = "logintodevinotele"; //логин для сервиса отправки sms
$password = "passworddevinotele"; //пароль для сервиса отправки sms
$sourceaddress = "HUISHA"; //Заголовок сообщения
$destinationaddress = preg_replace('/[^0-9]/', '', $tel); //Номер телефона с удаленными скобочками и прочим $Data = generateSmsID(4); //сгенерированный пароль
$validity = "10"; //Время жизни в минутах
$linktosms= "https://i...content-available-to-author-only...i.net/rest/v2/Sms/Send?Login=" . $login . "&Password=" .
$password . "&SourceAddress=" . $sourceaddress . "&DestinationAddress=" .
$destinationaddress . "&Data=" . $Data . "&Validaty=" . $validity;
PD9waHAKCiAgICAKLy/RhNGD0L3QutGG0LjRjyDQtNC70Y8g0LPQtdC90LXRgNCw0YbQuNC4INC60L7QtNCwINC00LvRjyBzbXMKZnVuY3Rpb24gZ2VuZXJhdGVTbXNJRCgkbGVuZ3RoID0gOCkgewogICAgJGNoYXJzID0gJzAxMjM0NTY3ODknOwogICAgJG51bUNoYXJzID0gc3RybGVuKCRjaGFycyk7CiAgICAkc3RyaW5nID0gJyc7CiAgICBmb3IgKCRpID0gMDsgJGkgPCAkbGVuZ3RoOyAkaSsrKSB7CiAgICAgICAgJHN0cmluZyAuPSBzdWJzdHIoJGNoYXJzLCByYW5kKDEsICRudW1DaGFycykgLSAxLCAxKTsKICAgIH0KICAgIHJldHVybiAkc3RyaW5nOwp9CgokdGVsID0gZmlsdGVyX2lucHV0KElOUFVUX1BPU1QsICdwaG9uZScsIEZJTFRFUl9TQU5JVElaRV9TUEVDSUFMX0NIQVJTKTsKLy8kc2Vzc2lvbklEPSAgZ2VuZXJhdGVTZXNzaW9uSUQoMzIpOwokbG9naW4gPSAibG9naW50b2Rldm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