登陆

发送验证码displayservice器连接失败

事情是this样的,我手上一套程序,有一个短信验证码功能,Now搭建出来,发送验证码displaythis样

O1JRQBMC5AYBOTDVE~B3X(2.png

我刚start以为是修改代码probably误删了某些文件,however我去找以前能正常使用的源代码部署出来So is itthis个effect,短信接口调试都是正常的,唯独this个点击发送验证码就连接service器失败,also还有一个userxia dan短信notice我的,也不会发送了,就很迷,求助大神强看555~

 $host = "https://cxkjsms.market.alicloudapi.com";
    $path = "/chuangxinsms/dxjk";
    $method = "POST";
    $appcode = "8324d57716e84d518532ac4631fe6a04";//开通service后 买家core-查看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";//开通service后 买家core-查看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));

麻烦各位大神有空帮我看下哪里的problem

# PHP
十二泉十二泉8 天前146 武

全部回复(2)我要回复

  • 十二泉

    十二泉2020-09-02 17:40:26

    download源代码

    https://weiling.lanzous.com/iJdhXgahmoj

    回复
    0
  • 十二泉

    十二泉2020-09-02 17:39:48

    我直接把源码放stay蓝奏网盘了,麻烦大神帮忙看看

    download源代码

    回复
    0
  • cancel回复发送