为什么它总是返回true?
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_TIMEOUT, 4);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_string);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml; charset=utf-8', 'Content-Length: '.strlen($post_string),'SOAPAction:urn:RemoteUserStoreManagerServiceHttpsSoap11Endpoint','Authorization: Basic YWRtaW46YWRtaW4=' ));
$data = curl_exec($ch);
if($data===true){
echo"<script>location.assign('utente.php')</script>";
}else{
echo"<script>location.assign('index.php?a=0')</script>";
}
我尝试了很多解决方案但没有一个成功
答案 0 :(得分:0)
只需删除此行即可 curl_setopt($ ch,CURLOPT_RETURNTRANSFER,1);