事情是这样的,我手上一套程序,有一个短信验证码功能,现在搭建出来,发送验证码显示这样
我刚开始以为是修改代码可能误删了某些文件,但是我去找以前能正常使用的源代码部署出来也是这个效果,短信接口调试都是正常的,唯独这个点击发送验证码就连接服务器失败,并且还有一个用户xia dan短信通知我的,也不会发送了,就很迷,求助大神们看看555~
$host = "https://cxkjsms.market.alicloudapi.com"; $path = "/chuangxinsms/dxjk"; $method = "POST"; $appcode = "8324d57716e84d518532ac4631fe6a04";//开通服务后 买家中心-查看AppCode $headers = array(); array_push($headers, "Authorization:APPCODE " . $appcode); $bodys = ""; $url = $host . $path . "?" . $querys; $curl = curl_init(); curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_FAILONERROR, false); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_HEADER, true); if (1 == strpos("$".$host, "https://")) { curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); } var_dump(curl_exec($curl));
}//获取手机短信验证码 elseif($mod == "login"){ $type = daddslashes($_POST['type']); $shouji = daddslashes($_POST['shouji']); $pass = daddslashes($_POST['pass']); $code = daddslashes($_POST['code']); if($results){ if($results['response'] == 1){ if($type == 1){ if($shouji == "" || $code == ""){ $result = array("code"=>-1,"msg"=>"手机号或验证码不能为空!"); }elseif(!preg_match("/^1[34578]{1}\d{9}$/",$shouji)){ $result = array("code"=>-2,"msg"=>"手机号不合法!"); }elseif($code != $_SESSION['code']){ $result = array("code"=>-3,"msg"=>"验证码错误!"); }else{ $result = array("code"=>0,"msg"=>"验证成功,请稍后..."); $_SESSION['Mao_login'] = 1; $_SESSION['user'] = $shouji; unset($_SESSION['code']); } }elseif($type == 2){ $cha_1 = $DB->get_row("select * from mao_user where M_id='{$mao['id']}' and users='{$shouji}' limit 1"); if($shouji == "" || $pass == ""){ $result = array("code"=>-1,"msg"=>"手机号或密码不能为空!"); }elseif(!preg_match("/^1[34578]{1}\d{9}$/",$shouji)){ $result = array("code"=>-2,"msg"=>"手机号不合法!"); }elseif(!$cha_1){ $result = array("code"=>-3,"msg"=>"未设置登陆密码,请使用短信验证码登陆!"); }else{ if($cha_1['pass'] == $pass){ $result = array("code"=>0,"msg"=>"验证成功,请稍后..."); $_SESSION['Mao_login'] = 1; $_SESSION['user'] = $cha_1['users']; unset($_SESSION['code']); }else{ $result = array("code"=>-4,"msg"=>"登陆密码错误!"); } } }else{ $result=array("code"=>-2000,"msg"=>"非法操作已记录信息!"); } }else{ $result=array("code"=>-2000,"msg"=>"[{$results['response']}],{$results['err_msg']}"); } }else{ $result=array("code"=>-2000,"msg"=>"验证失败!"); } exit(json_encode($result));
$host = "https://cxkjsms.market.alicloudapi.com"; $path = "/chuangxinsms/dxjk"; $method = "POST"; $appcode = "8324d57716e84d518532ac4";//开通服务后 买家中心-查看AppCode $headers = array(); array_push($headers, "Authorization:APPCODE " . $appcode); $bodys = ""; $url = $host . $path . "?" . $querys; $curl = curl_init(); curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_FAILONERROR, false); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_HEADER, true); if (1 == strpos("$".$host, "https://")) { curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); } var_dump(curl_exec($curl));
麻烦各位大神有空帮我看下哪里的问题