xxxxxxxxxx
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.fast2sms.com/dev/wallet",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_SSL_VERIFYHOST => 0,
CURLOPT_SSL_VERIFYPEER => 0,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => array(
"authorization: YOUR_API_KEY"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
xxxxxxxxxx
server {
# Listing port and host address
# If 443, make sure to include ssl configuration for the same.
listen 80;
listen [::]:80;
server_name 192.168.0.132;
index index.php;
root /var/www/html/mainproject/public;
# Handle main root / mainproject
location / {
#deny all;
try_files $uri $uri/ /index.php?$args;
}
# via factcgi PHP-FPM unix socket
location ~ \.php$ {
set $newurl $request_uri;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php8.3-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param REQUEST_URI $newurl;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors off;
fastcgi_buffer_size 16k;
fastcgi_buffers 4 16k;
}
# Deny .ht* access
location ~ /\.ht {
deny all;
}
}
xxxxxxxxxx
// Account details
$auth_key = urlencode(‘YourAuthKey’);
// Message details
$mobiles = array(919999999990, 919999999999);
$sender = urlencode(‘sender id’);
$message = rawurlencode(‘"Hello from Shree Tripada! Exciting news awaits!"’);
$mobiles = implode(‘,’, $mobiles);
// Prepare data for POST request
$data = array(‘auth_key’ => $auth_key, ‘mobiles’ => $mobiles, “sender” => $sender, “message” => $message);
// Send the POST request with cURL
$ch = curl_init(‘https://sms.shreetripada.com/api/sendapi.php/’);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
// Process your response here
echo $response;