Ad Widget

Collapse

Sms script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rockford333
    Junior Member
    • Dec 2009
    • 4

    #1

    Sms script

    Hello,

    Finally I got working the email. I am trying the sms script of clickatell its not working. the code i am using is given below
    Code:
    #!/usr/bin/php
    <?php
    /*****************************************
    *smsclickatell
    *
    * A simple script to send an SMS via
    * www.clickatell.com.
    *
    *
    *****************************************/
    
    // Set the following three values:
    
    $apiid="3216538";
    $user="sayeed333";
    $password="GINdijl8";
    
    
    // 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"][3];
    $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);
    
    ?>
    I am getting the following error
    Code:
    /etc/zabbix/smsclickatell: /usr/bin/php: bad interpreter: Permission denied
  • Danie.Krige
    Junior Member
    • Jan 2010
    • 1

    #2
    RE: Sms script

    Hi rockford333,

    Looks like it as a problem invoking PHP and not a problem with the actual script. Possibly your "hash bang" on top of the script?

    Also, please keep in mind that you need to change your Clickatell password and not to display it in the open (rather hide it). You do not want that to fall in the wrong hands.

    Kind Regards
    Danie Krige

    Comment

    Working...