Re: detecting type of field from $_POST ?
| From: | Chris Shiflett | Date: | Tue, 06 Apr 2004 04:14:25 +0000 |
| Subject: | Re: detecting type of field from $_POST ? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-182438@lists.php.net to get a copy of this message | ||
--- adwinwijaya <adwinwijaya@yahoo.com.au> wrote:
> i just wonder, is there any way to detecting the type of field
> (like textarea, button, radio, etc) from $_REQUEST / $_POST ?
Nope.
> I need to detect that all .. because I want to put a script that
> will remove html tag
You should filter all POST data, regardless of type. The reason is the
same as why you cannot distinguish them - only name/value pairs are
returned. Don't assume your HTML can restrict the type of data that a user
can send.
Hope that helps.
Chris
=====
Chris Shiflett - http://shiflett.org/
PHP Security - O'Reilly
Coming Fall 2004
HTTP Developer's Handbook - Sams
http://httphandbook.org/
PHP Community Site
http://phpcommunity.org/