[eluser]porta_ss[/eluser]
I need to use a model (called "insertor"). When I call it inside
Code:
if($this->form_validation->run() !== FALSE){}
...it just doesn't work. But if I replace
Code:
if($this->form_validation->run() !== FALSE){}
with
...or anything else...it works :roll: I can't get it right...what's wrong with this line...
Code:
if($this->form_validation->run() !== FALSE){}
????? I have another project too and in that one everything works properly...I spent some time comparing and comparing...nothing seems to be different...but one works...the other doesn't. Form_validation actually works, cause i can see errors being displayed when form is incomplete. but I just can't access the model from within that strange if() statement. Please help me out...
Code:
<?php
class Parser extends Controller{
function Parser()
{
parent::Controller();
$this->load->helper (array('form','url'));
$this->load->library('form_validation');
$this->load->model('insertor');
}
function nou()
{
//Rules
$this->form_validation->set_rules('nume', 'Nume', 'required|min_length[2]');
$this->form_validation->set_rules('prenume', 'Prenume', 'required');
$this->form_validation->set_rules('oras', 'Oras', 'required');
$this->form_validation->set_rules('email', 'Email','required|valid_email');
$this->form_validation->set_rules('telefon', 'Telefon', 'required');
$this->form_validation->set_rules('referrer', 'Referrer', 'required');
//Post form data
$nume = $this->input->post('nume');
$prenume = $this->input->post('prenume');
$oras = $this->input->post('oras');
$email = $this->input->post('email');
$telefon = $this->input->post('telefon');
$cui = $this->input->post('cui');
$referrer = $this->input->post('referrer');
$ocupatia = $this->input->post('ocupatia');
$varsta = $this->input->post('varsta');
$adresa = $this->input->post('adresa');
$timp = $this->input->post('timp');
$mesaj = $this->input->post('mesaj');
//IF FORM IS FINE
if($this->form_validation->run() !== FALSE)
{
$this->insertor->new_reseller($nume,$prenume,$oras,$email,$telefon,$cui,$referrer,$ocupatia,$varsta,$adresa,$timp,$mesaj);
}
//IF FORM IS INCOMPLETE
else
{
$a['uri'] = 'reselleri_webdesign';
$this->load->view('body/reselleri_view',$a);
}
}
}
?>