<?php
class Customer extends CI_controller
{
public function __construct()
{
parent::__construct();
$this->load->model('Customer_model');
}
public function create()
{
$this->load->helper('form');
$this->load->library('form_validation');
$this->form_validation->set_rules('name', 'Title', 'required');
$this->form_validation->set_rules('address', 'text', 'required');
if ($this->form_validation->run() === FALSE)
{
$this->load->helper('url');
$this->load->view('templates/header');
$this->load->view('master/customer');
}
else
{
$this->Customer_model->register();
$this->load->view('templates/header');
$this->load->view('templates/success');
}
}
}
I have inserted data successfully to the table using this code. After I have tried to display the same header template and the center part (success.php) it is showing a blank page. After commenting the header page it is working I.E. The success page is coming.
I think you need to load
the helper
also above it:
$this->load->helper('url');