我在mvc框架codeigniter
中有一個名爲article
的控制器。控制器(php)錯誤。這是什麼意思?
直到我上傳到主機,這個控制器沒有錯誤。
這是錯誤:
Fatal error: Can't use method return value in write context in /home/focusweb/public_html/cms/application/controllers/administrator/article.php on line 17
而且我的控制器:(有符合17
一個問題,但它在localhost
作品)
<?php if (! defined('BASEPATH')) exit('No direct script access allowed');
class Article extends CI_Controller {
public function index() {
$this->home();
}
public function home() {
if($this->session->userdata('is_logged_in')){
$this->load->view("site_header");
$this->load->model("db_login");
$data['first_name'] = $this->db_login->get_name($user_id);
$this->load->view("site_nav", $data);
$user_id = $this->session->userdata('uid');
$data['name'] = "";
if(isset($this->input->post("mysubmit"))){
$data['name'] = $this->input->post("name");
$data['content'] = $this->input->post("content");
}
$this->load->model("db_new_category");
//get hierarchal data from database
$get_all_category = $this->db_new_category->get_all_category();
//manage hierarchal data and send them to view
$this->load->model("hierarchy");
$this->load->model("db_new_category");
$get_all_category = $this->db_new_category->get_all_category();
$this->load->model("hierarchy");
$data1 = $this->hierarchy->get_hierarchy($get_all_category, 'category_name_db', 'deep', 'id', 'count');
$data = $data + $data1;
$this->load->view("add_article", $data1);
$this->load->view("site_footer");
}
else redirect('administrator/login');
}
第17行是在這裏:
if(isset($this->input->post("mysubmit"))){
請這裏的代碼複製粘貼文本,而不是作爲一個屏幕截圖。 – JJJ 2015-01-31 18:46:34
@Juhana完成:) – 2015-01-31 18:56:59
[參考 - 這個錯誤在PHP中意味着什麼?](http://stackoverflow.com/questions/12769982/reference-what-does-this-error-mean-in-php ) – deceze 2015-02-01 11:25:54