2017-02-07 6 views
0

このCurlライブラリをこのサイトから使用しようとしています。 Link to the Curl Library存在しないクラス:CI_Curl

彼らは明らかに、私は同じことを行っている

ci_demo > system > libraries > curl.php 

の内側に私のライブラリファイルを置くことを述べています。私のコントローラにロードしようとすると、このエラーが表示されます:Non-existent class: CI_Curl。 私のコードは次のとおりです。カールの

<?php 
if (! defined('BASEPATH')) exit('No direct script access allowed'); 
class Users extends CI_Controller { 
    public function __construct() 
    { 
     parent::__construct(); 
     $this->load->model('user_model'); 

    } 

    public function getAllUsers(){ 

    $this->load->library('curl'); 

// Setting URL To Fetch Data From 
$this->curl->create('https://www.formget.com/'); 

// To Temporarily Store Data Received From Server 
$this->curl->option('buffersize', 10); 

// To support Different Browsers 
$this->curl->option('useragent', 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8 (.NET CLR 3.5.30729)'); 

// To Receive Data Returned From Server 
$this->curl->option('returntransfer', 1); 

// To follow The URL Provided For Website 
$this->curl->option('followlocation', 1); 

// To Retrieve Server Related Data 
$this->curl->option('HEADER', true); 

// To Set Time For Process Timeout 
$this->curl->option('connecttimeout', 600); 

// To Execute 'option' Array Into cURL Library & Store Returned Data Into $data 
$data = $this->curl->execute(); 

// To Display Returned Data 
echo $data; 
} 
//and so on 

答えて

1

変更クラス名:図書館右の

class Curl { 

class CI_Curl { 
+0

? –

+0

はい。システム>ライブラリ> curl.php –

+0

私もファイル名をchaangeする必要がありますか?右? –

関連する問題