Curl in codeigniter

前端 未结 2 989
醉酒成梦
醉酒成梦 2021-01-24 04:27

I want to use curl in my codeigniter application. But I am getting null array.

My code is like this:

$this->load->library(\'curl\');
$url = \"http:         


        
相关标签:
2条回答
  • 2021-01-24 04:59

    If you're using the cURL library, you should have this at the bare minimum.

    $this->load->library('curl');
    $url = "http://url/checkweb.php"; 
    $post_data = array ( 
        "foo" => "bar", 
        "query" => "Nettuts", 
        "action" => "Submit" 
    );
    $output = $this->curl->simple_post($url, $post_data);
    
    0 讨论(0)
  • 2021-01-24 05:07

    URL passed to cURL should be absolute-full-with-domain.

    Instead of:

    $url = "url/checkweb.php"; 
    

    try:

    $url = "http://yourdomain.com/url/checkweb.php"; 
    
    0 讨论(0)
提交回复
热议问题