Php SMS sending function-function for sending text messages created by the php SMS interface

Source: Internet
Author: User
Tags sendmsg
Php short message sending function-text message sending function created by the php short message interface author: zccst version 1: Sometimes when you are using php integration, text messages are often used on webpages, the text message can be sent as a function to facilitate future calls. If you can define a Function in Function. php, the code is as follows: php SMS sending Function-the short message sending Function created by the php SMS interface
Author: zccst
Version 1:
Sometimes, when you are using php integration, text messages are often used on webpages. you can send text messages as a function to facilitate future calls.

If you can define a Function in Function. php, the code is as follows:
Function smsto ($ telphone, $ message) {// user name of the SMS interface $ uid. if there is no or cannot be sent, contact customer service QQ: 272927682 $ uid = 'qxt01 '; // SMS interface password $ passwd = '000000'; // sent to the target mobile phone number $ telphone // $ telphone = '000000 '; // change your mobile phone number here // The text message 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 = {$ message1} & SEQ = 1000 "; $ result = file_get_contents ($ gateway); return $ result ;}

Then implement sending on the relevant page, and return the sending result as follows:
$ SendMember = $ _ POST ["SendMember"]; // Note: You can specify the mobile phone number $ SendMSG = $ _ POST ["SendMSG"] by yourself. // Note: You can specify the content $ smsok = smsto ($ SendMember, $ SendMSG) based on the text message you entered );


The return value 1 indicates that the operation is successful. For more information about the returned values, see the interface description.



Version 2:
Step 1: First register a member account at www.woxp.cn;

Step 2: Insert the code in the test. php file:
 



Step 3: Browse test. php. if the parameter is correctly configured, the text message can be successfully sent to the preset mobile phone number!

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.