D
D
dobryshkin2015-03-11 14:18:36
Parsing
dobryshkin, 2015-03-11 14:18:36

Curl sending sms through mts website?

The bottom line is that you need to send SMS from the mts website through your personal account using cURL.
not so long ago there was such an opportunity, besides, there is no captcha if you go to your personal account.
All suitable scripts on the Internet that pull out balances, balances of packages, minutes, SMS, use the light (mobile) version of the Internet assistant site, and there is no way to send SMS.
the only script that I found on the Internet (pbal.sh), which takes data from lk.mts.ru, is already outdated and does not work.
no matter how I can even log in
, an example of the code that I tried to at least log in to:

<?php
    # Настройки
    $login = '919*******'; # Логин
    $password = '***'; # Пароль
    $url = 'https://login.mts.ru/amserver/UI/Login'; # Адрес страницы, куда отправляется форма
    
    # Инициализируем сеанс CURL
    if( !$ch = curl_init() )
        # Ошибка
        die( "Невозможно создать сеанс CURL. Возможно у вас не установлена эта библиотека." );
        
    # Данные, передаваемые методом POST (тут укажите названия полей формы авторизации)
    $data = array(
        'phone' => $login, # Передаём логин
        'password' => $password, # Передаём пароль
        'submit' => 'Войти' # Передаём имя кнопки (возможно на сайте идёт проверка нажатия кнопки)
    );
    
    # Массив настроек CURL
    $options = array(
    CURLOPT_USERAGENT => 'Opera/10.00 (Windows NT 5.1; U; ru) Presto/2.2.0',
        CURLOPT_URL => $url, # Ссылка на сайт
        CURLOPT_FOLLOWLOCATION => true, # Следование Location
        CURLOPT_POST => true, # Передаём данные методом POST
        CURLOPT_POSTFIELDS => $data, # POST данные
        CURLOPT_SSL_VERIFYHOST => false, # Не проверяем сертификат SSL
        CURLOPT_TIMEOUT => 10, # Таймаут запроса в секундах,
        CURLOPT_COOKIEJAR => 'cookie.txt', # Файл, куда сохраняются COOKIE (для последующих запросов)
        CURLOPT_COOKIEFILE => 'cookie.txt'
    );
    
    # Устанавливаем опции
    curl_setopt_array( $ch, $options );
 
    # Выполняем запрос
    $html = curl_exec( $ch );
 
    # Закрываем сеанс CURL
    curl_close( $ch );
?>

ps at the moment, the "sms gateway" application on the android phone is used for mailing, the scripts on the server send letters to the soap, and the phone checks the mail every minute and sends SMS as soon as a new letter appears.
but the downsides are that the phone sits down faster, it must be constantly turned on and the Internet must work

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Shiklgruber, 2015-03-22
@aaadddminnn

1. Specify the user agent
2. Set the headers
3. Set the referrer
MTS check is tricky. you need to build a "user" from yourself

V
vic_vega, 2016-09-28
@vic_vega

You are connecting to the https protocol and not http. Add.

curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question