Пример #1
0
function sendSMS($uid, $pwd, $mobile, $content, $time = '', $mid = '')
{
    $http = 'http://api.cnsms.cn/';
    $data = array('ac' => 'send', 'uid' => $uid, 'pwd' => strtolower(md5($pwd)), 'mobile' => $mobile, 'content' => $content, 'time' => '2010-05-27 12:11');
    $re = postSMS($http, $data);
    //POST方式提交
    if (trim($re) == '100') {
        return "发送成功!";
    } else {
        return "发送失败!";
    }
}
Пример #2
0
function sendSMS($uid, $pwd, $mobile, $content, $time = '', $mid = '')
{
    $http = 'http://http.yunsms.cn/tx/';
    $data = array('uid' => $uid, 'pwd' => strtolower(md5($pwd)), 'mobile' => $mobile, 'content' => iconv('utf-8', 'gbk', $content), 'time' => $time, 'mid' => $mid);
    $re = postSMS($http, $data);
    //POST方式提交
    if (trim($re) == '100') {
        return true;
    } else {
        return "发送失败! 状态:" . $re;
    }
}
Пример #3
0
function sendSMS($http, $uid, $pwd, $mobile, $content, $mobileids, $time = '', $mid = '')
{
    $data = array('uid' => $uid, 'pwd' => md5($pwd . $uid), 'mobile' => $mobile, 'content' => $content, 'mobileids' => $mobileids);
    $re = postSMS($http, $data);
    //POST方式提交
    //$re = getSMS($url,$data='');		//GET方式提交
    if (strstr($re, 'stat=100')) {
        return "发送成功!";
    } else {
        if (strstr($re, 'stat=101')) {
            return "验证失败! 状态:" . $re;
        } else {
            return "发送失败! 状态:" . $re;
        }
    }
}
Пример #4
0
function sendSMS($mobile, $content, $time = '', $mid = '')
{
    $content = iconv('utf-8', 'gbk', $content);
    $http = 'http://http.yunsms.cn/tx/';
    $uid = '2105111190';
    // 用户账号
    $pwd = '8m8&le8sl';
    // 密码
    $data = array('uid' => $uid, 'pwd' => strtolower(md5($pwd)), 'mobile' => $mobile, 'content' => $content, 'time' => $time, 'mid' => $mid);
    $re = postSMS($http, $data);
    //POST方式提交
    $re_t = substr(trim($re), 3, 3);
    if (trim($re) == '100' || $re_t == '100') {
        return "发送成功!";
    } else {
        return "发送失败! 状态:" . $re;
    }
}
Пример #5
0
function sendSMS($mobile, $content, $time = '', $mid = '')
{
    $content = iconv('utf-8', 'gbk', $content);
    $http = 'http://http.yunsms.cn/tx/';
    // 短信接口
    $uid = '57137';
    // 用户账号
    $pwd = 'e5k9r6';
    // 密码
    $data = array('uid' => $uid, 'pwd' => strtolower(md5($pwd)), 'mobile' => $mobile, 'content' => $content, 'time' => $time, 'mid' => $mid);
    $re = postSMS($http, $data);
    // POST方式提交
    // change_sms change_start
    $re_t = substr(trim($re), 3, 3);
    if (trim($re) == '100' || $re_t == '100') {
        return true;
    } else {
        return false;
    }
}
Пример #6
0
function sendSMS($m, $c)
{
    $url = 'http://smsapi.c123.cn/OpenPlatform/OpenApi';
    //接口地址
    $ac = '1001@500975760001';
    //用户账号
    $authkey = '38B45363B0CD29AFA8CF3683A21AD26E';
    //认证密钥
    $cgid = '2177';
    $csid = '52';
    //签名编号 ,可以为空时,使用系统默认的编号
    $t = '';
    $data = array('action' => 'sendOnce', 'ac' => $ac, 'authkey' => $authkey, 'cgid' => $cgid, 'm' => $m, 'c' => $c, 'csid' => $csid, 't' => $t);
    $xml = postSMS($url, $data);
    //POST方式提交
    $re = simplexml_load_string(utf8_encode($xml));
    return $re['result'];
}
Пример #7
0
function sendSMS($mobile, $content, $time = '', $mid = '')
{
    $http = 'http://api.sms.cn/mtutf8/ ';
    $uid = 'bjczcf';
    $pwd = 'bjczcf';
    $mobileids = '';
    $data = array('uid' => $uid, 'pwd' => md5($pwd . $uid), 'mobile' => $mobile, 'content' => $content, 'mobileids' => $mobileids, 'time' => $time);
    $re = postSMS($http, $data);
    //POST方式提交
    return $re;
}
Пример #8
0
function sendSMS($mobile, $content, $time = '', $mid = '')
{
    $uid = modC('SMS_UID', '', 'USERCONFIG');
    $pwd = modC('SMS_PWD', '', 'USERCONFIG');
    $http = modC('SMS_HTTP', '', 'USERCONFIG');
    if (empty($http) || empty($uid) || empty($pwd)) {
        return '管理员还未配置短信信息,请联系管理员配置';
    }
    $data = array('account' => iconv('GB2312', 'GB2312', $uid), 'pswd' => iconv('GB2312', 'GB2312', $pwd), 'mobile' => $mobile, 'msg' => iconv('GB2312', 'GB2312', '验证码:123123'));
    $re = postSMS($http, $data);
    //POST方式提交
    if (trim($re) == '100') {
        return "发送成功!";
    } else {
        return "发送失败! 状态:" . $re;
    }
}
Пример #9
0
function sendSMS($uid, $pwd, $mobile, $content, $time = '', $mid = '')
{
    $http = 'http://http.c123.com/tx/';
    $data = array('uid' => $uid, 'pwd' => strtolower(md5($pwd)), 'mobile' => $mobile, 'content' => $content, 'time' => $time, 'mid' => $mid);
    $re = postSMS($http, $data);
    //POST方式提交
    if (trim($re) == '100') {
        return "发送成功!";
    } else {
        return "发送失败! 状态:" . $re;
    }
}
Пример #10
0
function sendSMS($uid, $pwd, $mobile, $content, $time = '', $mid = '')
{
    //验证短信
    //账号55220,密码8p6hri
    //账号55215  密码rfkda9
    //提醒短信
    //$content = urlencode($content);
    $http = 'http://http.yunsms.cn/tx/';
    $data = array('uid' => $uid, 'pwd' => strtolower(md5($pwd)), 'mobile' => $mobile, 'content' => $content, 'time' => $time, 'mid' => $mid);
    $re = postSMS($http, $data);
    return $re;
    /* $re= postSMS($http,$data);			//POST方式提交
    	if( trim($re) == '100' )
    	{
    		return "发送成功!";
    	}
    	else 
    	{
    		return "发送失败! 状态:".$re;
    	} */
}
Пример #11
0
function sendSMS($mobile, $content, $time = '', $mid = '')
{
    $uid = modC('SMS_UID', '', 'USERCONFIG');
    $pwd = modC('SMS_PWD', '', 'USERCONFIG');
    $http = modC('SMS_HTTP', '', 'USERCONFIG');
    if (empty($http) || empty($uid) || empty($pwd)) {
        return '管理员还未配置短信信息,请联系管理员配置';
    }
    $data = array('uid' => $uid, 'pwd' => strtolower(md5($pwd)), 'mobile' => $mobile, 'content' => $content, 'time' => $time, 'mid' => $mid, 'encode' => 'utf8');
    $re = postSMS($http, $data);
    //POST方式提交
    if (trim($re) == '100') {
        return "发送成功!";
    } else {
        return "发送失败! 状态:" . $re;
    }
}
Пример #12
0
function sendSMS($mobile, $msg)
{
    $http = 'http://api.106msg.com/TXTJK.aspx';
    $data = array('type' => 'send', 'ua' => 'openclass', 'pwd' => 'taisha2012', 'gwid' => '43', 'mobile' => $mobile, 'msg' => $msg);
    $re = postSMS($http, $data);
    //POST方式提交
    if (trim($re) == '1') {
        return "发送成功!";
    } else {
        return trim($re);
    }
}
Пример #13
0
function sendSMS($mobile, $content, $time = '', $mid = '')
{
    $uid = modC('SMS_UID', '', 'USERCONFIG');
    $pwd = modC('SMS_PWD', '', 'USERCONFIG');
    $http = modC('SMS_HTTP', '', 'USERCONFIG');
    $smssp = modC('SMS_SP', '', 'USERCONFIG');
    $accountsid = modC('SMS_ACCOUNTSID', '', 'USERCONFIG');
    $token = modC('SMS_TOKEN', '', 'USERCONFIG');
    $appId = modC('SMS_APPID', '', 'USERCONFIG');
    $templateId = modC('SMS_TEMPLATEID', '', 'USERCONFIG');
    if (empty($http) || empty($uid) || empty($pwd)) {
        return '管理员还未配置短信信息,请联系管理员配置';
    }
    $data = array('uid' => $uid, 'pwd' => strtolower(md5($pwd)), 'mobile' => $mobile, 'content' => $content, 'time' => $time, 'mid' => $mid, 'encode' => 'utf8');
    if (strstr($smssp, "ucpaas")) {
        //云之讯的短信发送
        //初始化必填
        $options['accountsid'] = $accountsid;
        //填写自己的
        $options['token'] = $token;
        //填写自己的
        //初始化 $options必填
        $ucpass = new Ucpaas($options);
        //随机生成6位验证码
        srand((double) microtime() * 1000000);
        //create a random number feed.
        $ychar = "0,1,2,3,4,5,6,7,8,9";
        $list = explode(",", $ychar);
        for ($i = 0; $i < 6; $i++) {
            $randnum = rand(0, 9);
            // 10+26;
            $authnum .= $list[$randnum];
        }
        //短信验证码(模板短信),默认以65个汉字(同65个英文)为一条(可容纳字数受您应用名称占用字符影响),超过长度短信平台将会自动分割为多条发送。分割后的多条短信将按照具体占用条数计费。
        $appId = $appId;
        //填写自己的
        $to = $mobile;
        // $templateId = "1";
        $param = $authnum;
        $param = $param . ",10";
        //添加短信模板的第二个参数,“您的验证码为{1},请于{2}分钟内正确输入验证码”
        $arr = $ucpass->templateSMS($appId, $to, $templateId, $param);
        if (substr($arr, 21, 6) == 00) {
            D('Verify')->addSMSVerify($to, $authnum);
            //保存验证短信到验证码表
            //如果成功就,这里只是测试样式,可根据自己的需求进行调节
            return "短信验证码已发送成功,请注意查收短信";
        } else {
            //如果不成功
            return "短信验证码发送失败,请联系客服";
        }
    } else {
        $re = postSMS($http, $data);
        //POST方式提交
        if (trim($re) == '100') {
            return "发送成功!";
        } else {
            return "发送失败! 状态:" . $re;
        }
    }
}
Пример #14
0
function sendSMS($uid, $pwd, $mobile, $content, $time = '', $mid = '')
{
    $http = C(MSGAPI);
    $data = array('ac' => 'send', 'uid' => $uid, 'pwd' => strtolower(md5($pwd)), 'mobile' => $mobile, 'content' => $content, 'encode' => 'utf8');
    $re = postSMS($http, $data);
    //POST方式提交
    if (trim($re) == '100') {
        return "OK";
    } else {
        return trim($re);
    }
}