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 ?
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.
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
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?
Yes i want a script to past in my site and my friends can send sms free from my site with clickatel gateway ?
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:
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 = ' <font color="#009900">Beschikbaar</font>'; } else if ( xmlHttp.responseText == 'Nothing' ) { document.getElementById("mailresult").innerHTML = ' '; } else { document.getElementById("mailresult").innerHTML = ' <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"> </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:
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
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.