Exemplo n.º 1
0
 public static function sendMessage($p_telephone, $p_msg)
 {
     $_r = null;
     if (W2String::isTelephone($p_telephone)) {
         // $strSendMsg = $p_msg;
         // $strSendMsg = iconv('UTF-8', 'GBK', $strSendMsg);
         // $strSendMsg = urlencode($strSendMsg);
         // $_r = '测试期,暂不发送实际短信';
         // $strUrl ="http://125.208.9.42:8080/WS/Send.aspx?CorpID=btapp&Pwd=123456&Mobile={$strTelephone}&Content={$strSendMsg}";
         // $_r = W2Web::loadStringByUrl($strUrl);
         $data = array();
         $data['user'] = W2Config::$SMS_USER;
         $data['passwd'] = W2Config::$SMS_PASSWD;
         $data['msg'] = $p_msg;
         //短消息内容,UTF-8编码
         $data['mobs'] = $p_telephone;
         //手机号码,逗号分隔,个数最多100
         $data['ts'] = date('YmdHi', time());
         //计划发送时间,格式“yyyyMMddHHmm”,默认当前
         $data['dtype'] = 0;
         //响应数据格式;0,普通字串,1.XML格式,默认0
         $data['passwd'] = md5($data['user'] . $data['passwd']);
         //MD532位加密用户名和API密码
         $_r = W2Web::loadStringByUrl('http://api5.nashikuai.cn/SendSms.aspx', 'post', $data);
     }
     return $_r;
 }
Exemplo n.º 2
0
 /**
  * 查询快递信息
  * @param  string $postid 快递单号
  * @param  string $type   快递类型
  * shentong  ---> 申通
  * ems    ---> EMS
  * shunfeng   --> 顺丰
  * yuantong  -->  圆通
  * zhongtong  --> 中通
  * yunda   -->  韵达
  * tiantian   --->  天天快递
  * huitongkuaidi  -->  汇通快递
  * quanfengkuaidi  -->   全峰快递
  * debangwuliu    -->   德邦物流
  * zhaijisong    -->   宅急送
  * @return [type]         [description]
  */
 public static function query($postid = "268323324324", $type = "shentong")
 {
     $post_data = array("type" => $type, "postid" => $postid);
     $url = 'http://www.kuaidi100.com/query';
     $result = W2Web::loadStringByUrl($url, 'get', $post_data);
     return json_decode($result, true);
 }
Exemplo n.º 3
0
 public static function actionTest()
 {
     $result = W2Web::loadStringByUrl('http://api-haoye.appzd.net/apitest/apitest.php', 'post', $_POST, array("Test:\r\n", 'Test2:2'));
     echo $result;
     exit;
 }
Exemplo n.º 4
0
 /**
  * 删除所有Cookie
  */
 public static function clearCookie()
 {
     if (is_array($_COOKIE)) {
         foreach ($_COOKIE as $key => $value) {
             W2Web::removeCookie($key);
         }
     }
 }