Welcome Guest, Not a member yet? Register   Sign In
Weird problem with validation library
#1

[eluser]Vang[/eluser]
I'm sending post data to a controller with AJAX. Then I run a validation to see if the fields were filled or empty.

In the beginning of the controller i got a line:
Code:
die ($this->input->post('url') . ' - ' . $this->input->post('title'));
This echoes the values i filled in the form correctly.

Then I run the validation:
Code:
$rules['url']    = "required";
$rules['title']    = "required";
$this->validation->set_rules($rules);

if ($this->validation->run() == FALSE){....
The validation always fails.
When i try to echo the data again after the validation has run it echoes empty values.

I thought that it must be because of XSS filtering but the validation fails even
when i send pure numeric values.

After the validation even the $_POST array is erased.
In other parts of the same application (even in the same controller) everything works perfect with validation.

Any ideas what could be wrong ?




Theme © iAndrew 2016 - Forum software by © MyBB