Welcome Guest, Not a member yet? Register   Sign In
sanitize and validation
#1

[eluser]keithics[/eluser]
Hello,

I would like to know if I can validate and sanitize $this->input->get_post('string') ??

I am doing ajax calls to my controller. Can I still use the form_validation using ajax?



Thanks,
Fivel
#2

[eluser]Sbioko[/eluser]
Amm, everything is possible, but form validation is for form validation. I think. Not for ajax. You still have native PHP's validation functions. Use them. No need in sanitizing if you turned on global xss cleaning in config.php.
#3

[eluser]keithics[/eluser]
Xss filtering is good but not enough. I think I have to look into the form_validation and get some functions there.

I need to filter the min and max length , alphanumeric etc..
#4

[eluser]Sbioko[/eluser]
So, you can use form validation library for ajax, if it is a POST request, not GET. Try it. Why not? ;-)
#5

[eluser]keithics[/eluser]
It does work!
#6

[eluser]Sbioko[/eluser]
Congrats!




Theme © iAndrew 2016 - Forum software by © MyBB