遇到 PHP 错误
严重性:警告
消息:无法修改标头信息 - 标头已发送(输出开始于 /srv/disk5/1241421/www/ebazzar.co.nf/application/models/product_model.php:2)
文件名:库/Session.php
行号:672
...
遇到 PHP 错误
严重性:警告
消息:无法修改标头信息 - 标头已发送(输出开始于 /srv/disk5/1241421/www/ebazzar.co.nf/application/models/product_model.php:2)
文件名:helpers/url_helper.php
行号:542
我该如何解决这个错误?在数据库中添加一些内容时出现
函数是这样的:
public function signup() {
if ($this->authex->logged_in()) {
redirect('welcome');
}
//$data['page'] = $this->uri->segment(2);
$data['fproducts'] = $this->pm->get_fproducts();
$data['countries'] = $this->pm->get_countries();
if ($this->input->post('submit_signup')) {
if ($this->_form_validate() == FALSE) {
$this->load->view('header', $data);
$this->load->view('sidebar');
$this->load->view('signup');
$this->load->view('footer');
} else {
$signup_id = $this->pm->add_user();
if ($signup_id) {
$this->session->set_flashdata('message', array('title' => 'Signup Result', 'content' => 'You have been successfully registered', 'type' => 'message'));
redirect("welcome/home");
}
}
} else {
$this->load->view('header', $data);
$this->load->view('sidebar');
$this->load->view('signup');
$this->load->view('footer');
}
}