//验证码发送
function sendmessage($mobile)
{
$code=rand(1000,9999);
include(ROOT_PATH."SmsDemo.php");
// 调用示例:
header('Content-Type: text/plain; charset=utf-8');
$demo = new SmsDemo(
"阿里云key",
"阿里云secret"
);
$response = $demo->sendSms(
"短信签名", // 短信签名
"模板号", // 短信模板编号
$mobile, // 短信接收者
Array( // 短信模板中字段的值
"code"=>$code,
),
""
);
cookie("code",$code,60*5);
cookie("phone",$mobile,60*5);
if($response->Code=='OK'){
responseAjax(200,'短信发送成功');
}else{
responseAjax(400,'请求失败');
}
}
感谢博主,喝杯咖啡~
感谢博主,喝杯咖啡~
如果爱他,接受他的现在,别幻想他的改变。如果他能改,当然最好,不然,就想一想,你能不能接受。婚前的每一个缺点,婚后都会被放大。他抽烟,而你又爱他,就努力接受吧,婚后戒烟的男人太少了。其他缺点也是一样。