The API allows you to send messages through your projects and services over HTTP/HTTPS, SMTP and SMPP protocols. Ready-made libraries in different programming languages connect to your project and help you send messages from anywhere with a single command. For simplified authorization, instead of a login and password pair, you can use a special API key.
Connecting anti-spam verification (captcha) to the site
Sometimes there is a need to send messages from your site at the request of users, and in such cases, to exclude automated
spam mailings with the help of robots, you can easily implement anti-spam verification using our service.
To do this, it is enough to place a special code for displaying the image (captcha) and fields for entering the code on the form for sending messages:
Код с картинки <img src="https://smscentre.com/sys/imgcode.php?1.1" onclick="src+=1" width="50" height="18" border="1"> <input type="text" size="9" name="code">
and pass it with other form data to the corresponding message sending script as the value of the imgcode parameter.
Also, with this parameter, you must pass the value of the IP address of the user to whom the image was displayed as the value of the userip parameter.
Examples:
Example of a script for sending messages using the code from the image (captcha) received from the form:
include_once "smsc_api.php";
if ($_POST["sendsms"]) { $r = send_sms($_POST["phone"], "Ваш код для регистрации на сайте mysite.com 123321.", 0, 0, 0, 0, false, "imgcode=".$_POST["code"]."&userip=".$_SERVER["REMOTE_ADDR"]);
if ($r[1] > 0) echo "<script>alert('Сообщение отправлено на номер ".$_POST["phone"]."')</script>"; elseif ($r[1] == -10) echo "<script>alert('Вы ввели неверный код с картинки!')</script>"; }
This site uses cookies to improve its functionality. By using the site, you agree to this. To close