当前位置: 首页>>代码示例>>PHP>>正文


PHP Sms::sendSMS方法代码示例

本文整理汇总了PHP中Sms::sendSMS方法的典型用法代码示例。如果您正苦于以下问题:PHP Sms::sendSMS方法的具体用法?PHP Sms::sendSMS怎么用?PHP Sms::sendSMS使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Sms的用法示例。


在下文中一共展示了Sms::sendSMS方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actionDelete

 public function actionDelete()
 {
     $id = $this->_get('id');
     $user_id = $this->_get('user_id');
     $obj = User::model()->findByPk($user_id);
     if ($id && Report::model()->deleteByPk($id)) {
         $mobile = $obj->mobile;
         if (isset($mobile) && $mobile) {
             // $type =='register','forget',
             $sms = new Sms();
             $result = $sms->sendSMS($mobile, '您好,你的反馈我们已近收到,我们将尽快处理,Urtime谢谢你的宝贵意见', 'true');
             $result = $sms->execResult($result);
             if ($result[1] == 0) {
                 // echo '发送成功';
                 Yii::app()->user->setFlash('send', 1);
                 $this->redirect(array('report/index'));
             } else {
                 //echo "发送失败{$result[1]}";
                 Yii::app()->user->setFlash('send', 0);
                 $this->redirect(array('report/index'));
             }
         } else {
             Yii::app()->user->setFlash('report', 0);
             $this->redirect(array('report/index'));
         }
     } else {
         Yii::app()->user->setFlash('report', 0);
         $this->redirect(array('report/index'));
     }
 }
开发者ID:kl0428,项目名称:admin,代码行数:30,代码来源:ReportController.php

示例2: sms

 public function sms()
 {
     //注册时发送的验证码
     vendor('Sms.Sms');
     $phone = $_POST["username"];
     $method = $_POST["method"];
     /*$rules=array(
     			array('username','','手机号已经存在!',0,'unique',1), // 在新增的时候验证name字段是否唯一
     		);
     		*/
     $user = M("user_manage");
     //检查手机号的合法性
     if (preg_match("/1[34578]{1}\\d{9}/", $phone)) {
         //$result=;
         //isset($result));
         if ($method == "lostpass") {
             //找回密码
             if ($user->where("username={$phone} and state=1")->find()) {
                 $verify = rand(1000, 9999);
                 vendor('Msg.msg');
                 $msg = new \msg(M());
                 $m = $msg->createMsg(0, 'repass', array('validNum' => $verify));
                 //$m="您的验证码为$verify";
                 $sms = new \Sms();
                 $tag = $sms->sendSMS($phone, $m);
                 if ($tag == 1) {
                     //数据库中改手机号已经注册,但未注册成功
                     $data["validity"] = time();
                     $data["verify"] = $verify;
                     $user->where("username={$phone}")->save($data);
                 }
                 echo $tag;
             } else {
                 echo "手机号未注册";
             }
         } else {
             //首次注册
             //检查手机号是否注册成功
             if ($user->where("username={$phone} and state=1")->find()) {
                 echo "手机号已经注册";
             } else {
                 $verify = rand(1000, 9999);
                 vendor('Msg.msg');
                 $msg = new \msg(M());
                 $m = $msg->createMsg(0, 'login', array('validNum' => $verify));
                 $sms = new \Sms();
                 $tag = $sms->sendSMS($phone, $m);
                 if ($tag == 1) {
                     $result = $user->where("username={$phone} and state=1")->find();
                     if ($result) {
                         //数据库中改手机号已经注册,但未注册成功
                         $data["validity"] = time();
                         $data["verify"] = $verify;
                         $user->where("username={$phone}")->save($data);
                     } else {
                         //数据库改手机号未注册过
                         $data["username"] = $phone;
                         $data["state"] = 0;
                         $data["verify"] = $verify;
                         $data["validity"] = time();
                         $user->add($data);
                     }
                 }
                 echo $tag;
             }
         }
     } else {
         echo "您的手机号码不合法";
     }
 }
开发者ID:htom78,项目名称:project,代码行数:70,代码来源:UserController.class.php

示例3: Sms

    $roles = "商户管理员,管理商户编号为" . $shop;
}
//发送短信通知
if ($role == 1) {
    $sql = "select msgContext from msgModule where catID=0 and catName='addadmin'";
} else {
    if ($role == 2) {
        $sql = "select msgContext from msgModule where catID=0 and catName='addmall'";
    } else {
        $sql = "select msgContext from msgModule where catID=0 and catName='addshop'";
    }
}
$msgresult = mysql_query($sql);
$row = mysql_fetch_array($msgresult);
$sms = new Sms();
$sms->sendSMS($phone, $row["msgContext"]);
//发送邮件通知
if ($role == 1) {
    $sql = "select msgContext from msgModule where catID=1 and catName='addadmin'";
} else {
    if ($role == 2) {
        $sql = "select msgContext from msgModule where catID=1 and catName='addmall'";
    } else {
        $sql = "select msgContext from msgModule where catID=1 and catName='addshop'";
    }
}
$msgresult = mysql_query($sql);
$row = mysql_fetch_array($msgresult);
$system_info_result = mysql_query("select * from system_info");
$system_info = mysql_fetch_array($system_info_result);
$smtp_info = explode("@", $system_info["email"]);
开发者ID:htom78,项目名称:project,代码行数:31,代码来源:add_manage_account_do.php


注:本文中的Sms::sendSMS方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。