468,766 Members | 1,305 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,766 developers. It's quick & easy.

validating user input: regex vs. filters?

I have decided that Since I have to update the processing on many of my
forms, I'm going to start them all over from scratch. Before I begin I
thought I'd solicit comments on using the PHP regex functions vs using
the filter functions for cleaning and validating user input.

Jun 2 '08 #1
3 1422
On Sun, 11 May 2008 16:56:01 +0200, William Gill <no*****@example.com>
wrote:
I have decided that Since I have to update the processing on many of my
forms, I'm going to start them all over from scratch. Before I begin I
thought I'd solicit comments on using the PHP regex functions vs using
the filter functions for cleaning and validating user input.
What are the 'filter functions' you're talking about?

Besides that, validating is often just using the right tool for the job.
Is it a number, is a record in a database that should exist etc... All
depending on the desired implementation.

--
Rik Wasmus
[SPAM] Now temporarily looking for some smaller PHP/MySQL projects/work to
fund a self developed bigger project, mail me at rik at rwasmus.nl. [/SPAM]
Jun 2 '08 #2
Rik Wasmus wrote:
What are the 'filter functions' you're talking about?
filter_has_var()
filter_id()
filter_input_array()
filter_input()
filter_list()
filter_var_array()
filter_var()

But I now realize they are part of an installable extension, not core
PHP. So the point may be moot, since I no longer run my own servers
(and thus can't control extension installation)
Besides that, validating is often just using the right tool for the job.
Is it a number, is a record in a database that should exist etc... All
depending on the desired implementation.
.... and preventing unwanted or hazardous input, and so on, so I asked
about two of the many tools I see in PHP.
Jun 2 '08 #3
William Gill wrote:
>
But I now realize they are part of an installable extension, not core
PHP. So the point may be moot, since I no longer run my own servers
(and thus can't control extension installation)
per phpinfo() it is installed and available on my host's servers so I'm
still curious to hear peoples thoughts.
Jun 2 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by The Plankmeister | last post: by
4 posts views Thread by John Livermore | last post: by
5 posts views Thread by Peter Morris [Air Software Ltd] | last post: by
2 posts views Thread by SL | last post: by
9 posts views Thread by chuck | last post: by
4 posts views Thread by joesin | last post: by
232 posts views Thread by robert maas, see http://tinyurl.com/uh3t | last post: by
5 posts views Thread by Anthony Smith | last post: by
6 posts views Thread by Richard | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.