public function index()
{
$error = 0;
$realname = "";
$username = "";
$word = "";
$this->load->helper(array('form', 'url','file'));
$this->load->library('form_validation');
$config = array(
array('field' => 'rname', 'label' => 'RealName', 'rules' => 'required', 'errors' => array( 'required' => 'Provide%s')),
array('field' => 'uname', 'label' => 'Username', 'rules' => 'required', 'errors' => array( 'required' => 'Provide%s')),
array('field' => 'word', 'label' => 'Word', 'rules' => 'required', 'errors' => array( 'required' => 'Provide%s'))
);
$this->form_validation->set_rules($config);
if ($this->form_validation->run() == FALSE)
{
$this->load->view('names');
}
else
{
$realname = $this->input->post('rname');
$username = $this->input->post('uname');
$word = $this->input->post('word');
if(!file_exists("C:xampp/htdocs/file1/$realname")) exit ("$realname DoesNotExist");
if(!file_exists("C:xampp/htdocs/file2/$realname/$username")) exit ("$username DoesNotExist");
if(!file_exists("C:xampp/htdocs/file3/$realname/$word")) exit ("$word DoesNotExist");
if(isset($_POST['submit'])) redirect(BASE_URL.'home');
}
}