PHP的SMS Server Tools 3驱动网管程序
来源:互联网 发布:seo文章内链 编辑:程序博客网 时间:2024/06/06 00:02
有关SMS Server Tools 3的配置和使用见上一偏文章,这篇来分享我的PHP驱动程序(转载请注明出处):
<?php/** * Created by JetBrains PhpStorm. * User: zzly jiangyeziwh@gmail.com * Date: 12-7-23 * Time: 下午6:21 * To change this template use File | Settings | File Templates. */// header('Content-Type:text/html; charset = GBK');// 创建短信文件function createSms ($smsfile, $phone, $message){ if($handle = fopen($smsfile, "w")) { $body = stripcslashes(urldecode($message)); fputs($handle, "To:$phone\n"); fputs($handle, "Alphabet: UCS\n"); fputs($handle, "\n"); if(strlen($body) > 0) { $body = iconv('UTF-8', 'UCS-2BE', $body); fputs($handle, "$body"); } else { fputs($handle, "\n"); } fclose($handle); } else { return 2; }}// 展开短信组function externGroup ($groupfile){ if(is_readable($groupfile)) { $lines = file($groupfile); foreach($lines as $tempstring) { $tempstring = explode("\t", $tempstring); $phone[] = $tempstring[0]; } return $phone; } else { die ("Can't open unreadable file!"); }}?><?php// 发送主程序// 接口// $ghp = $_GET['ghp'];// $hp = $_GET['hp'];// $rawmsg = $_GET['msg'];
//示例
$ghp = "";$hp = "186****2580";$rawmsg = "这是PHP程序发送的";// $msg = iconv("UTF-8", "GBK//IGNORE", $rawmsg);$smsd_work_dir = "/var/spool/sms/outgoing/";$group_file_dir = "/var/spool/sms/data/";if($ghp == ""){ if($hp == "") { die("Phone number is null"); } else { $sms_file_name = $smsd_work_dir . "GSM1." . rand(10000, 99999); $phone = "86" . $hp; createSms($sms_file_name, $phone, $rawmsg); echo "Send succuse!"; }}else{ $groupfile = $group_file_dir . $ghp . "txt"; externGroup($groupfile); foreach(externGroup($groupfile) as $phonenumber) { $sms_file_name = $smsd_work_dir . "GSM1." . rand(10000, 99999); $phone = "86" . $phonenumber; createSms($sms_file_name, $phone, $msg); echo "Send succuse!"; }}?>
- PHP的SMS Server Tools 3驱动网管程序
- SMS Server Tools 3
- SMS Server Tools配置文件及使用详解
- 老外的sms程序
- 快速开发SMS应用的程序接口
- 手机短信息SMS的程序开发
- 手机短信息SMS的程序开发
- 手机短信息SMS的程序开发
- 手机短信息SMS的程序开发
- 【网管知识】Windows Server 2003 的id事件查询列表
- SMS 短信发送程序
- php网管系统
- php程序来连接SQL Server数据库的通用类
- php程序来连接SQL Server数据库的通用类
- SMS-Push激活J2ME程序
- Android中SMS收发程序
- mongodb的php驱动
- 【Little_things】事件驱动的带界面的Client/Server聊天小程序(java socket)
- apache2.2.21下配置url地址重写 去掉index.php
- C++静态成员函数小结(转)
- (莱昂氏unix源代码分析导读-47) exec
- VC++6.0调试出错 One or more breakpoints cannot be set and have been disabled...
- 左手手型投篮姿势教程
- PHP的SMS Server Tools 3驱动网管程序
- 读取国航三字码的PROPERTIES
- PHP相关系列 - PHP缓存使用的一个陷阱
- thrift
- VM tools与Ubuntu的安装
- java.util.ConcurrentModificationException解决
- 并查集&MST题集
- EVC下安装Visual Assist的详细步骤
- 我在北京!(2)