Application of sms api in the most popular open-source group buying program

Source: Internet
Author: User

Group BuyingProgramIt is a good open-source PHP + MySQL program, which is favored by many webmasters. She originally provided her own text message interface, but the text message price is not very cheap, you can use the modification in the most soil. (Modify the text message sending or subscription content)

Open the most Earth program file/Include/function/SMS. phpThe original SMS sending function is as follows:

 1   Function Sms_send ( $ Phone , $ Content  ){  2       Global   $ Ini  ;  3       If (Mb_strlen ( $ Content , 'Utf-8') <5 ){  4           Return 'The text message length is less than 5 Chinese characters? Long time ~ ' ;  5   }  6       $ User = Strval ( $ Ini ['Ms'] ['user' ]);  7       $ Pass = Strtolower ( MD5 ( $ Ini ['Ms'] ['pass' ]);  8       If ( Null = $ User ) Return   True  ;  9       $ Content = Urlencode ( $ Content  );  10      $ API = "Http://notice.zuitu.com/sms? User = { $ User } & Pass = { $ Pass } & Phones = { $ Phone } & Content = { $ Content }" ;  11       $ Res = Utility: httprequest ( $ API  );  12       Return   Trim ( Strval ($ Res ) = '+ OK '? True : Strval ( $ Res  );  13 }

Change to (enter the account information in sms9 before use)

 Function Sms_send ( $ Phone , $ Content  ){  Global   $ Ini  ;  If (Mb_strlen ($ Content , 'Utf-8') <5 ){  Return 'The text message length is less than 5 Chinese characters? Long time ~ ' ;}  $ User = ''; //  CPID of sms9      $ Pass = ''; //  Password for sms9      $ Channelid = ''; //  The ID of the sms9 channel.      If (Null = $ User ) Return   True  ;  $ Content = Iconv ("UTF-8", "GBK // ignore ", $ Content  );  $ Content = Urlencode ( $ Content  );  $ API = "Http://admin.sms9.net/houtai/sms.php? CPID = {$ User } & Password = { $ Pass } & Channelid = { $ Channelid  } & Tele = {  $ Phone } & MSG = { $ Content }" ;  $ Res = Utility: httprequest ( $ API  );  Return   Strpos ( Strval ( $ Res ), 'Success') = False ? Strval ( $ Res ): True ;

Source http://www.sms9.net/info_view_35928.html

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.