usr local bin php php smsclickatell simple script to send an SMS via w

 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
#!/usr/local/bin/php
<?php
/*
* smsclickatell
*
* A simple script to send an SMS via
* www.clickatell.com.
*
*
*/
Set the following three values:
$apiid = “221111”;
$user = “username”;
$password = “password”;
Do not change anything beneath this line:
if ($_SERVER[”argc”]<3) {
die (”Usage: “.$_SERVER[”argv”][0].” recipientmobilenumber message\n”);
}
$apiargs = array();
$apiargs[”api_id”]=$apiid;
$apiargs[”user”]=$user;
$apiargs[”password”]=$password;
$apiargs[”to”]=$_SERVER[”argv”][1];
$apiargs[”text”]=$_SERVER[”argv”][2];
$apiargs[”from”]=”Zabbix”;
$apiargs[”req_feat”]=32;
$url = “http://api.clickatell.com/http/sendmsg?”;
foreach ($apiargs as $k⇒$v) $url.=”$k=”.urlencode($v).”&”;
@file_get_contents($url);