找不到对象..控制器无法找到该功能

时间:2014-08-27 16:53:34

标签: php codeigniter

这是我的控制者

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Admin extends CI_Controller {


      public function __construct()

    {
        parent::__construct();

       $this->load->helper('url');
       $this->load->Model('Mod_admin');

    }

    public function index()
    {
        $this->load->helper(array('form')); //login purposes
        $this->load->view('template/header');
        $data['branches'] = $this->Mod_admin->getAllBranches();
        $this->load->view('index',$data);

    }


    public function account()
    {
        $this->load->view('account', array('error' => ' ' ));
    }

    public function do_upload()
    {
        $config['upload_path'] = './uploads/';
        $config['allowed_types'] = 'gif|jpg|png';


        $this->load->library('upload', $config);

        if ( ! $this->upload->do_upload())
        {
            $error = array('error'=>$this->upload->display_errors());
            $this->load->view('account', $error);
        }
        else
        {
            $data=array('upload_data'=>$this->upload->data());
            $this->load->view('success', $data);
        }
    }


}//last curly

这是我的ACCOUNT.PHP位于观点

<html>
<body>
<?php echo form_open_multipart('http://localhost/do_upload');?>

<input type="file" name="userfile" />

<br /><br />

<input type="submit" value="upload" />

</form>
</body>
</html>

当我上传文件时,它会重定向到一个显示“找不到对象”的页面。我想我的链接有问题..请帮帮我......抱歉我的语法不好

0 个答案:

没有答案