PHP SMS send function--php SMS interface manufacturing SMS send function

Source: Internet
Author: User
Tags sendmsg
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!
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.