Welcome Guest, Not a member yet? Register   Sign In
Best way to solve unwanted uri characters.
#9

[eluser]eedfwChris[/eluser]
[quote author="walesmd" date="1186639647"]I am assuming this ID is referencing an ID within a table - therefore, you don't just want to determine if it's numeric and allow it to run.

In the model that is returning data for this controller - have it checks the num_rows() and return FALSE if it's 0, then plan accordingly within your controller.

This way, someone can't pass /view/29834798327493249873294798324783274082378047 and your site go "WTF!?"[/quote]

Yea, my problem was when you type in a non numeric character like "e" in my example the query would go "WTF!?" because I am not quoting it in the query (as I am comparing an integer not a string).

Anyhoo, thanks guys! I will be using ctype_digit... This solves the decimal problem I was thinking by using is_numeric.


Messages In This Thread
Best way to solve unwanted uri characters. - by El Forum - 08-08-2007, 02:56 PM
Best way to solve unwanted uri characters. - by El Forum - 08-08-2007, 03:17 PM
Best way to solve unwanted uri characters. - by El Forum - 08-08-2007, 03:57 PM
Best way to solve unwanted uri characters. - by El Forum - 08-08-2007, 04:35 PM
Best way to solve unwanted uri characters. - by El Forum - 08-08-2007, 06:25 PM
Best way to solve unwanted uri characters. - by El Forum - 08-08-2007, 07:07 PM
Best way to solve unwanted uri characters. - by El Forum - 08-08-2007, 09:24 PM
Best way to solve unwanted uri characters. - by El Forum - 08-09-2007, 12:16 AM
Best way to solve unwanted uri characters. - by El Forum - 08-09-2007, 09:44 AM



Theme © iAndrew 2016 - Forum software by © MyBB