Re: Easier way to clean GET Variables ?
| From: | Robert Cummings | Date: | Thu, 25 Aug 2005 13:19:50 +0000 |
| Subject: | Re: Easier way to clean GET Variables ? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-221352@lists.php.net to get a copy of this message | ||
On Thu, 2005-08-25 at 03:14, Richard Lynch wrote:
> On Wed, August 24, 2005 10:06 pm, Graham Anderson wrote:
> > Is there a way to loop thru all of these GET requests by:
> > putting the GET variables into an array
> > processing the variable strings with trim/striptags/etc in a loop
> > exploding the variables back out into separate variables
>
> In addition to what everybody has posted...
>
> I really would recommend that on any given page you have something like:
>
> $_EXPECTED = array('userID', 'playlistName', 'language');
> $_EXPECTED = array_flip($_EXPECTED);
This isn't necessary if you don't import variables, but rather retrieve
them one by one as in the example I showed. Since there you essentially
denote valid input vars by virtue of retrieval rather than automating
the import.
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com
|
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'