public function index() {
$sn = "账号";
$pwd = "加密后的密码";
$mobile = '手机号';
$content = '您好,感谢注册该软件,请输入手机验证码12345【group401】';
$ext = '';
$rrid = '';
$stime = '';
$stype = 1;
$ssafe = 1;
$scode = 1; // 1表示UTF-8,2表示GB2312
$MARK = "|";
$Md5key = "dfg78er";
$Md5Sign = md5 ( $sn . $MARK . $pwd . $MARK . $mobile . $MARK . $content . $MARK . $ext . $MARK . $rrid . $MARK . $stime . $MARK . $stype . $MARK . $ssafe . $MARK . $scode . $MARK . $Md5key );
$target = "http://你的sdk网址";
$subdate = "sn=" . $sn . "&pwd=" . $pwd . "&Md5Sign=" . $Md5Sign . "&mobile=" . $mobile . "&content=" . urlencode ( $content ) . "&ext=" . $ext . "&stime=" . $stime . "&rrid=" . $rrid . "&stype=" . $stype . "&ssafe=" . $ssafe . "&scode=" . $scode;
$sendMsgID = $this->SudasSmsPost ( $target, $subdate );
if ($sendMsgID > 1) {
echo '短信发送成功 请查收 返回值' . $sendMsgID;
} else {
echo '短信发送失败,请根据返回值查看相关错误问题 返回值' . $sendMsgID;
}
}
public function SudasSmsPost($url, $request) {
$output = true;
$show_header = false;
$ch = curl_init ();
curl_setopt ( $ch, CURLOPT_URL, $url );
curl_setopt ( $ch, CURLOPT_POSTFIELDS, $request ); // 发送的数据
curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, $output ); // 设定返回的数据是否自动显示
curl_setopt ( $ch, CURLOPT_HEADER, $show_header ); // 设定是否显示头信息
$ReturnData = curl_exec ( $ch );
curl_close ( $ch );
return $ReturnData;
}
本站以现代、古代情诗为主,情诗网创办于2013年,以原创爱情诗歌、经典情诗、现代情诗、古代情诗、英文情诗、情诗绝句为主并收集古诗、古诗词、诗歌大全、诗词名句的文学门户。方便您下次继续阅读;可以放在浏览器的收藏夹中(快捷键Ctrl+D);或者看到喜欢或者有趣的诗词可以通过分享按钮给你的好友分享;情诗网是目前最全情诗大全网站之一。并欢迎广大诗歌爱好者阅览投稿!喜欢本站的话请大家把本站告诉给你朋友哦!地址是 www.qingshiwang.com !