CodeIgniter Forums
Weird problem with validation library - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Weird problem with validation library (/showthread.php?tid=9891)



Weird problem with validation library - El Forum - 07-11-2008

[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 ?