CodeIgniter Forums

Full Version: How to properly use GET attributes
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So it's really simple question, but i have to be sure that i make it in a right way 
I want to implement GET parameters for filtering
so i wanna get something like - mysite.com/cars/ford/?price_from=10&price_to=20
In this case - GET parameters are optional, and there could be a lot of them.
I don't want users to see PHP file. mysite.com/cars/ford/index.php?price_from=10&price_to=20 (or something like that)

So how do i properly implement this? I mean follow the codeigniter path

Just manually check native PHP - $_GET ?
And how do i setup route table?
You can enable query parameters if you want to use those for routing ... https://www.codeigniter.com/user_guide/g...ry-strings

If you just want to access query parameters ... then https://www.codeigniter.com/user_guide/l...-form-data
Do i need manually sanitize input data?
(07-13-2017, 10:32 AM)glorsh66 Wrote: [ -> ]Just manually check native PHP - $_GET ?

Yes.

(07-13-2017, 12:15 PM)glorsh66 Wrote: [ -> ]Do i need manually sanitize input data?

Validate, not sanitize.

Validation means rejecting invalid data.
Sanitization means trying to clean the shit of whatever you get, even if all you get is shit.