doushi8599 2017-02-07 05:21
浏览 44
已采纳

不存在的类:CI_Curl

I am trying to use this Curl Library from this site. Link to the Curl Library

They have clearly stated to put my Library file inside

 ci_demo > system > libraries > curl.php

I have done the same. When I try to load into my Controller it throws me this error: Non-existent class: CI_Curl. My code is :

<?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条回答 默认 最新

  • douhuan1901 2017-02-07 05:29
    关注

    change class name of curl:

    class Curl {
    

    to

    class CI_Curl {
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 matlab实现基于主成分变换的图像融合。
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制
  • ¥20 usb设备兼容性问题
  • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊