douniao8687
2012-03-12 16:23
浏览 48
已采纳

用php执行.cfm脚本

I'm using the following code to remotely execute a script:

$url = 'https://x.x.com/update_something.cfm?something_id=' . $id;
            $ch = curl_init();
            curl_setopt($ch, CURLOPT_URL, $url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
            $response = curl_exec($ch);
            curl_close($ch);

The script, however, it's not being executed (when I visit the url above from the browser, I can see the updated results, when doing it from the php script above nothing happens. PHP is not giving me any errors though, it just finishes the execution. What am I missing?

图片转代码服务由CSDN问答提供 功能建议

我正在使用以下代码远程执行脚本:

   $ url ='https://xxcom/update_something.cfm?something_id ='。  $ id; 
 $ ch = curl_init(); 
 curl_setopt($ ch,CURLOPT_URL,$ url); 
 curl_setopt($ ch,CURLOPT_RETURNTRANSFER,true); 
 curl_setopt($ ch,CURLOPT_SSL_VERIFYPEER,false); \  n $ response = curl_exec($ ch); 
 curl_close($ ch); 
   
 
 

脚本,但是,它没有被执行(当我访问网址时) 从浏览器上面我可以看到更新的结果,当从php脚本上面执行时没有任何反应。虽然PHP没有给我任何错误,它只是完成了执行。我错过了什么? < / DIV>

  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dongzhao5970 2012-03-12 17:18
    已采纳

    Adding curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); made it work! :)

    已采纳该答案
    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题