PHP SMS send function--php SMS interface making SMS Send function
Author: zccst
Version One:
Sometimes everyone in the PHP integration, often in the Web page to send text messages, then you can send text messages as a function to deal with, so convenient to call later.
If the function can be defined in function.php, the code is as follows:
function Smsto ($telphone, $message) {//SMS interface username $UID, if not or can not be sent please contact customer service qq:272927682 $uid = ' qxt01 ';//SMS Interface password $PASSWD $passwd = ' 123456 ';//The target mobile number sent to $telphone//$telphone = ' 13845689748 ';//change here to your mobile number//SMS content $message//$message = "This is a test message"; Message1 =urlencode (mb_convert_encoding ($message, ' utf-8 ', ' gb2312 ')); $gateway = "Http://sms.zgqxt.com/msgsend.ashx ? username={$uid}&password={$passwd}&mobile={$telphone}&content={$message 1}&seq=1000 "; $result File_get_contents ($gateway); return $result;}
Then implement the send in the related page and return the result as follows
$SendMember = $_post["Sendmember"]; Note: Take the user input hand number, you can also specify the mobile phone number $SendMSG = $_post["sendmsg"];//Description: Take the user input text message content, you can also specify the content $smsok =smsto ($ Sendmember, $SendMSG);
Returns 1 indicates success, more return values see the interface description.
Version Two:
First step: First to www.woxp.cn register a member account;
Step two: Insert the code in the test.php file:
The third step, browse test.php, if the parameters are configured correctly, then the SMS can successfully reach the preset mobile phone number, complete!