首先这个教程是非常简单的,如果只有注册有对接短信的需要,那就可以往下看,如果要对接的比较完全,那也可以将就的往下看,非常简单的教程,弊端很大,因为验证码是存在cookie里的所以高手勿喷。可以的话就把cookieMD5加密就好了,这里我不多说。
首先把做好的api接口文档传到根目录下。目录为../sms/alidayu/
主要的接口文件是api.php
"0", "contect"=>"请填写正确的手机号!")); return; } //输入验证码 $c = new TopClient; $c ->appkey = 'appkey' ; $c ->secretKey = 'secretKey' ; $req = new AlibabaAliqinFcSmsNumSendRequest; $req ->setExtend( "" ); $req ->setSmsType( "normal" ); $req ->setSmsFreeSignName( "签名" ); $req ->setSmsParam( "{code:'$code',product:'商城名'}" ); $req ->setRecNum( "$mobile" ); $req ->setSmsTemplateCode( "SMS_71185915" ); $resp = $c ->execute( $req ); $resp = (array) $resp; if (empty($resp) || !empty($resp['code'])) { echo json_encode(array("status" => 0, "contect" => "短信发送失败,请重试!(" . $resp['sub_msg'] . "/code: " . $resp['code'] . "/sub_code: " . $resp['sub_code'] . ")")); return; } echo json_encode(array("status" => 1 ,"contect" => "短信发送成功,请查收!")); ?>
[……]
→点此阅读全部←