Last active
November 20, 2015 04:44
-
-
Save hidayat365/a5bf2875a6920b78c60c to your computer and use it in GitHub Desktop.
SMS Sender ID Helper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function referrals_sms_sender($msisdn=FALSE, $message=FALSE, $uid=FALSE) | |
{ | |
global $user; | |
set_time_limit(0); | |
if ($msisdn and $message) { | |
// parameter | |
$hp = urlencode(htmlspecialchars($msisdn)); | |
$msg = urlencode(htmlspecialchars($message)); | |
$usr = "<user>"; | |
$pwd = "<pass>"; | |
$auth = MD5($usr.$pwd.$hp); | |
// coba panggil pakai resthelper | |
$app = "http://smpp.pusatsms.com:8080/web2sms/api/SendSMS.aspx"; | |
$url = $app."?username=$usr&mobile=$hp&auth=$auth&message=".$msg; | |
$web = rest_helper($url); | |
// log sms | |
if ($web) | |
referrals_sms_logger($uid?$uid:$user->uid,$msisdn,$message,$web,time()); | |
// tampilkan hasilnya | |
return $web ? $web : "Send Failed!"; | |
} else { | |
return 'Parameter not Supplied'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment