Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Your IP : 3.145.92.213
Current Path : /var/www/html/oums/src/ |
| Current File : /var/www/html/oums/src/api_sendsms.php |
<?php
function send_sms($sendnumb, $messtext)
{
$mess_sent = "";
include("sys_connect.php");
$mysql = "select * from sys_control";
$myres = mysqli_query($mycon, $mysql);
while ($row = mysqli_fetch_assoc($myres)) {
$username = $row['fmessuser'];
$password = $row['fmesspswd'];
$messfrom = $row['fmessfrom'];
$category = $row['fmesscatg'];
}
$messtext = urlencode($messtext);
$ch = curl_init();
if ($sendnumb != "") {
$sendnumbx = explode(',', $sendnumb);
foreach ($sendnumbx as $sendnumbi) {
$url = "https://http2.myvfirst.com/smpp/sendsms?";
$url .= "username={$username}&password={$password}&to={$sendnumbi}&from={$messfrom}&text={$messtext}&category={$category}";
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$myres = curl_exec($ch);
}
}
curl_close($ch);
return $myres;
// if($myres)
// {
// $mess_sent="T";
// }
// return $mess_sent;
}
|