CodeIgniter Forums
$_POST validation not FORM validation - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: $_POST validation not FORM validation (/showthread.php?tid=49943)



$_POST validation not FORM validation - El Forum - 03-08-2012

[eluser]xtarx[/eluser]
I want to validate some POST data from an 'httpRequest' using the same functions of

form validation , i did some how copy functions form the 'form_validation' library ,but is there any better way to do it?

I want to do something like this

Code:
$this->form_validation->set_rules($_post['username'], 'Username', 'required');
$this->form_validation->set_rules($_post['password'], 'Password', 'required');
$this->form_validation->set_rules($_post['email'], 'Email', 'required');



$_POST validation not FORM validation - El Forum - 03-08-2012

[eluser]Glazz[/eluser]
Replace:

Code:
'$_post['username']'

with

Code:
'username'


And do the same for the other inputs you are going to check, hope it works.


$_POST validation not FORM validation - El Forum - 03-08-2012

[eluser]xtarx[/eluser]
@Glazz

no , it didn work , I dont want to do Form validation because i dont have a form , i wantto use this validiton to validate some POST variables