Need help for sms gateway

Discussion in 'Programming' started by blue.st4r, Feb 26, 2008.

  1. #1
    Hallo bro's i have a question i have a account in clickatel.com but i cant active the sms gateway i need to active to send sms free from my site who can help me ?
     
    blue.st4r, Feb 26, 2008 IP
  2. ruby90

    ruby90 Peon

    Messages:
    721
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I can help you pm me
     
    ruby90, Feb 26, 2008 IP
  3. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #3
    surely if you have problems with clickatel you ask clickatel to help? And what are all these muppets with the "I can help, pm me" rubbish? If you can help, type your answer in the forum so that the next person who has the problem will get the help too and save us all seeing the same threads again and again and again and again and again.
     
    AstarothSolutions, Feb 26, 2008 IP
  4. ruby90

    ruby90 Peon

    Messages:
    721
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Manz I don't know what is his problem if he having problem with it I can help him if he pm send to me with details
     
    ruby90, Feb 27, 2008 IP
  5. blue.st4r

    blue.st4r Peon

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    im waiting. for help
     
    blue.st4r, Feb 27, 2008 IP
  6. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #6
    Use TM4B, they're cheaper than Clickatel.

    www.tm4b.com

    There won't be anything free...
     
    nico_swd, Feb 27, 2008 IP
  7. blue.st4r

    blue.st4r Peon

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    i have account in clickatel and purchased 1000$ i need help
     
    blue.st4r, Feb 27, 2008 IP
  8. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #8
    Can you be more specific about your problem? What code are you using, what doesn't work as expected?
     
    nico_swd, Feb 27, 2008 IP
  9. blue.st4r

    blue.st4r Peon

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    i need help to active to make that my friends can send sms from my sms gateway
     
    blue.st4r, Feb 28, 2008 IP
  10. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #10
    You still didn't describe your problem. Do you have an existing code which just doesn't work, or do you want a script? Or what is what you want?
     
    nico_swd, Feb 28, 2008 IP
  11. blue.st4r

    blue.st4r Peon

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Yes i want a script to past in my site and my friends can send sms free from my site with clickatel gateway ?
     
    blue.st4r, Feb 29, 2008 IP
  12. juust

    juust Peon

    Messages:
    214
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #12
    i'd take an ajax contact form and reprogram it to use the clickatel gateway.
    clickatel use their own api
    http://www.clickatell.com/developers/php.php

    <?
    $user = "user";
    $password = "password";
    $api_id = "xxxx";
    $baseurl ="http://api.clickatell.com";
    $text = urlencode("This is an example message");
    $to = "0123456789";
    // auth call
    $url = "$baseurl/http/auth?user=$user&password=$password&api_id=$api_id";
    // do auth call
    $ret = file($url);
    // split our response. return string is on first line of the data returned
    $sess = split(":",$ret[0]);
    if ($sess[0] == "OK") {
    $sess_id = trim($sess[1]); // remove any whitespace
    $url = "$baseurl/http/sendmsg?session_id=$sess_id&to=$to&text=$text";
    // do sendmsg call
    $ret = file($url);
    $send = split(":",$ret[0]);
    if ($send[0] == "ID")
    echo "success
    message ID: ". $send[1];
    else
    echo "send message failed";
    } else {
    echo "Authentication failure: ". $ret[0];
    exit();
    }
    ?>
    PHP:
     
    juust, Feb 29, 2008 IP
  13. juust

    juust Peon

    Messages:
    214
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #13
    I dont have a mobile phone
    so I cannot test it
    but the ajax part works

    and the rest is a matter of filling in
    
    $user = "user";
    $password = "password";
    $api_id = "xxxx";
    
    PHP:
    here's the html file click.html

       <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    
    <script type="text/javascript">
    function makeXmlHttp() {
            var xh = null;
            if(window.XMLHttpRequest)
            {
                    xh = new XMLHttpRequest();
            }
            else
            {
                    try
                    {
                            xh = new ActiveXObject("Microsoft.XMLHTTP");
                    }
                    catch(e)
                    {
                            window.alert("Browser doesnt support XMLHttpRequest object !");
                    }
            }
            return xh;
    }
    </script>
    <script type="text/javascript">
    function postmailform() {
            var vmsgname = document.getElementById("msgname").value;
            var vmsgpass = document.getElementById("msgpass").value;
            var vmsgmessage = document.getElementById("msgmessage").value;
            var vmsgnumberto = document.getElementById("msgnumberto").value;
    		xmlHttp = makeXmlHttp();
    
            xmlHttp.onreadystatechange = function()
            {
                    
                    if ( xmlHttp.readyState == 4 )
                    {
                            if ( xmlHttp.status == 200 )
                            {
                                    if ( xmlHttp.responseText == 'False' )
                                    {
                                            document.getElementById("mailresult").innerHTML = '&nbsp;&nbsp;<font color="#009900">Beschikbaar</font>';
                                    }
                                    else if ( xmlHttp.responseText == 'Nothing' )
                                    {
                                            document.getElementById("mailresult").innerHTML = '&nbsp;&nbsp;';
                                    }
                                    else
                                    {
                                            document.getElementById("mailresult").innerHTML = '&nbsp;&nbsp;<font color="#dd0000">' + xmlHttp.responseText + '</font>';
    										if ( xmlHttp.responseText.search("sender") != -1 ) {
    								        	document.getElementById("msgname").value='';
    								        	document.getElementById("msgpass").value='';
    								       		document.getElementById("msgmessage").value='';
    								       		document.getElementById("msgnumberto").value='';
    											}
                                    }
                            }
                    }
            }
    		alert('okay');
            xmlHttp.open("POST", "clickatel.php?msgname=" + vmsgname + "&msgnumberto=" + vmsgnumberto + "&msgpass=" + vmsgpass + "&msgmessage=" + vmsgmessage, true);
            xmlHttp.send('');
    
    }
    </script>
    </head>
    <body>
    
    <form method="post" name="mailform" id="mailform">
    
    <br /><label for="msgname">Name</label>
    <br /><input type="text" id="msgname" name="msgname" value=""  />
    
    <br /><label for="msgnumberto">To number</label>
    <br /><input type="text" id="msgnumberto" name="msgnumberto" value=""  />
    
    <br /><label for="msgpass">Password</label><br /><input type="text" id="msgpass" name="msgpass" value="" />
    
    <br /><label for="msgmessage">Message</label>
    <br /><textarea rows="4" cols="15" id="msgmessage" name="msgmessage" value="message"></textarea>
    
    <br />
    <br /><input type="button" value="send" onclick="postmailform()"  /><br />
    
    </form>
    
    <div id="mailresult">&nbsp</div>
    
    </body>
    </html>
    HTML:
    and the php file clickatel.php

    <?php
    session_start();
    
    $magicpassword="bimbo";
    
    if ($_SERVER["REQUEST_METHOD"] <> "POST") { die("You can only reach this page by posting from the html form"); }
    
    		$varmsgname=$_GET["msgname"];
    		$varmsgpass=$_GET["msgpass"];
    		$varmsgmessage=$_GET["msgmessage"];
    		$varmsgnumberto=$_GET["msgnumberto"];
    
    		$strError = "";
    
    		$hasError=false;
    
    		if ($varmsgpass<>$magicpassword) {
    			$hasError=true;
    			$strError = "no, bimbo, only with the right password the magic gate opens<br />";	
    		}
    
    		if (strlen($varmsgname)==0) {
    			$hasError=true;
    			$strError = "please enter your name<br />";	
    		}
    
    		if (strlen($varmsgnumberto)==0) {
    			$hasError=true;
    			$strError = "please enter a valid number<br />";	
    		}
    
    		if (strlen($varmsgmessage)==0) {
    			$hasError=true;
    			$strError .= "message is empty<br />";	
    		}
    
    		if ($hasError) {
    		echo $strError;
    		exit; }
    
    
    $mytext="From: ".$varmsgname."\n".$varmsgmessage;
    
    $user = "user";
    $password = "password";
    $api_id = "xxxx";
    
    $baseurl ="http://api.clickatell.com";
    
    $text = urlencode($mytext);
    $to = $varmsgnumberto;
    // auth call
    $url = "$baseurl/http/auth?user=$user&password=$password&api_id=$api_id";
    // do auth call
    $ret = file($url);
    // split our response. return string is on first line of the data returned
    $sess = split(":",$ret[0]);
    if ($sess[0] == "OK") {
    $sess_id = trim($sess[1]); // remove any whitespace
    $url = "$baseurl/http/sendmsg?session_id=$sess_id&to=$to&text=$text";
    // do sendmsg call
    $ret = file($url);
    $send = split(":",$ret[0]);
    if ($send[0] == "ID")
    echo "success
    message ID: ". $send[1];
    else
    echo "send message failed";
    } else {
    echo "Authentication failure: ". $ret[0];
    exit();
    }
    ?>
    PHP:
     
    juust, Feb 29, 2008 IP
  14. blue.st4r

    blue.st4r Peon

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #14
    juust but the api_id what is this ?
     
    blue.st4r, Feb 29, 2008 IP
  15. juust

    juust Peon

    Messages:
    214
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #15
    it's the key you use in software
    so the clickatell folk know what piece of software is sending the requests
    mostly as a double-check (next to user-password accounts).

    some companies put daily quota on the number of requests per api-key to
    prevent spamming and abuse

    you can request a key (for testing) here
    https://www.clickatell.com/central/user/client/step1.php?prod_id=2

    I dont have a mobile phone at hand
    so I cant get a test account,
    maybe other posters have one to spare
     
    juust, Feb 29, 2008 IP
  16. chadhaajay

    chadhaajay Member

    Messages:
    57
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #16
    API ID will be provided to you by Clickatel.com, If you have not received it then you cna contact them to get your API ID. Other than that, the solution is already provided by experts in messages above.
     
    chadhaajay, Feb 29, 2008 IP
  17. blue.st4r

    blue.st4r Peon

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #17
    blue.st4r, Mar 2, 2008 IP
  18. incognitoff

    incognitoff Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #18
    Adding information javamult.narod.ru
     
    incognitoff, Mar 2, 2008 IP
  19. blue.st4r

    blue.st4r Peon

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #19
    here are nothing postet that you can help me ?
     
    blue.st4r, Mar 2, 2008 IP
  20. blue.st4r

    blue.st4r Peon

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #20
    i need help can any one help me yes ore no ?
     
    blue.st4r, Mar 3, 2008 IP