-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.php
48 lines (35 loc) · 1 KB
/
main.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
$curl = curl_init();
/*
Get your SMSLink / SMS Gateway Connection ID and Password from
https://www.smslink.ro/get-api-key/
*/
$connectionId = "... My SMS Gateway Connection ID ...";
$password = "... My SMS Gateway Password ...";
$smsTo = "07xyzzzzzz";
$smsMessage = "My Test Message";
/*
HTTPS API Endpoint: https://secure.smslink.ro/sms/gateway/communicate/index.php
HTTP API Endpoint: http://www.smslink.ro/sms/gateway/communicate/index.php
*/
curl_setopt_array($curl, array(
CURLOPT_URL => "https://secure.smslink.ro/sms/gateway/communicate/index.php".
"?connection_id=".$connectionId.
"&password=".$password.
"&to=".$smsTo.
"&message=".urlencode($smsMessage),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HEADER => false,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_SSL_VERIFYHOST => false
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
?>