2015-06-25 93 views
0

我发布了一个问题,有人告诉我用户卷曲功能。我详细地挖掘并弄糊涂。 我是否必须安装curl,然后使用它才能使用curl函数传递值?卷曲安装

post_to_url("https://www.msgapp.com/RESTPostForm.aspx", $data); 
$data= array(
       "Customer"=> "ch", 
       "cke"=>"1", 
       "ownerid"=> "6", 
       "overwrite"=>"0", 
       "TriggerID"=> "1950", 
       "PushExternal"=> "1", 
       "City"=> "London", 
       "FirstName"=>"Test", 
       "LastName"=>"User", 
       "Email"=> "[email protected]" 
        );  
function post_to_url($url, $data) { 
    $fields = ''; 
    foreach($data as $key => $value) { 
     $fields .= $key . '=' . $value . '&'; 
    } 
    rtrim($fields, '&'); 

    $post = curl_init(); 

    curl_setopt($post, CURLOPT_URL, $url); 
    curl_setopt($post, CURLOPT_POST, count($data)); 
    curl_setopt($post, CURLOPT_POSTFIELDS, $fields); 
    curl_setopt($post, CURLOPT_RETURNTRANSFER, 1); 

    $result = curl_exec($post); 

    curl_close($post); 
} 
+1

是,一般说当前的世界秩序要求软件必须在使用之前安装。类似的问题问如何做到这一点(如果这不适合你的地方所有的地方)http://stackoverflow.com/questions/1347146/how-to-enable-curl-in-php-xampp –

+0

感谢您的评论,我想我在我的问题中说过,有人建议我使用curl,而我对此很陌生。你可以用简单易懂的方式解释我 – Jibran

回答

1

搜索php.ini文件 ';延长= php_curl.dll'

和除去在前面的分号,则可以运行卷曲功能

+0

嗨Chandu, 它已经被删除它可能是卷曲软件 – Jibran