$path, "width"=>$width, ); if ($is_hyaline==2 and $CodeType==1){ $send=array_merge($send, array("is_hyaline"=>true,)); } // var_dump($send);exit; $send = json_encode($send); $ch = curl_init();//初始化curl curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_URL, $ma_url); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,FALSE); curl_setopt($ch, CURLOPT_HEADER, FALSE); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_POSTFIELDS,$send); $data_save = curl_exec($ch);//运行curl // var_dump($data_save);exit; curl_close($ch); header("content-type: image/jpeg"); echo $data_save; }elseif($dir == "shopList"){ $path = "pages/shopList/shopList?"; $can = $_POST[$dir]; $path .= $can; $width = $_POST["width"]; if ($CodeType==1){ $ma_url = "https://api.weixin.qq.com/wxa/getwxacode?access_token=$access_token"; }else{ $ma_url = "https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode?access_token=$access_token"; } $send = array( "path"=>$path, "width"=>$width, ); if ($is_hyaline==2 and $CodeType==1){ $send=array_merge($send, array("is_hyaline"=>true,)); } $send = json_encode($send); $ch = curl_init();//初始化curl curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_URL, $ma_url); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,FALSE); curl_setopt($ch, CURLOPT_HEADER, FALSE); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_POSTFIELDS,$send); $data_save = curl_exec($ch);//运行curl // var_dump($data_save);exit; curl_close($ch); header("content-type: image/jpeg"); echo $data_save; }elseif($dir == "define"){ $hand = $_POST["define"]; $width = $_POST["width"]; if ($CodeType==1){ $ma_url = "https://api.weixin.qq.com/wxa/getwxacode?access_token=$access_token"; }else{ $ma_url = "https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode?access_token=$access_token"; } $send = array( "path"=>$hand, "width"=>$width //"is_hyaline"=>true, ); if ($is_hyaline==2 and $CodeType==1){ $send=array_merge($send, array("is_hyaline"=>true,)); } $send = json_encode($send); $ch = curl_init();//初始化curl curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_URL, $ma_url); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,FALSE); curl_setopt($ch, CURLOPT_HEADER, FALSE); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_POSTFIELDS,$send); $data_save = curl_exec($ch);//运行curl // var_dump($data_save);exit; curl_close($ch); header("content-type: image/png"); echo $data_save; } } } ?>