Products & Services‎ > ‎Keroncong SMS‎ > ‎playSMS‎ > ‎Documentation‎ > ‎For End User‎ > ‎

SMS Custom

Example case:
-----------------------
we need celphone users to send SMS to our playSMS number in format:
INFO <memberID>
for example:
INFO 11456198

and playSMS will reply with:
ID: <memberID> Name: <member's name>
or
READ FAQ, message format is: INFO memberID

in this case, playSMS should reply:
ID: 11456198 Name: anton

in SMS custom:
-------------------------
Keyword: INFO
URL: http://playsms.org/getname.php?ss={SMSSENDER}&cp={CUSTOMPARAM}

in playsms.org, file getname.php (in this case in /var/www/):
----------------------------------------------------------
<?php
$sms_sender = $_GET['ss'];
$memberID = $_GET['cp'];

if ($memberID) {
$query = "SELECT name FROM tblUser WHERE id='$memberID'";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
$name = $row['name'];
$reply = "ID: ".$memberID." Name: ".$name;
} else {
$reply = "READ FAQ, message format is: INFO memberID";
}

// WEBSERVICES part, sending SMS from another apps via playSMS
$u = 'anton'; // playsms user
$p = 'antonpass123456!@$@#"; // playsms user pass, in this case its
'anton' pass
$h = 'http://myplaysmsserver.org'; // playsms server
$ws = "$h/?app=webservices&u=$u&p=$p&ta=pv&to=$sms_sender&msg=$reply";
file_get_contents($ws);
?>

hopefully this make sense to you
to send SMS from another application or file please read
web/docs/WEBSERVICES

anton


Comments