Re: Stripping out and URL hacking characters from a URL
| From: | CPT John W. Holmes | Date: | Tue, 19 Aug 2003 18:22:21 +0000 |
| Subject: | Re: Stripping out and URL hacking characters from a URL | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-160049@lists.php.net to get a copy of this message | ||
From: "Matt Babineau" <matt@criticalcode.com>
> Does anyone have a function or something they have already written to
> remove any URL hacking characters, mainly the single quote, but I'm
> looking for a nice function to filter my _GET variables against. Gotta
> protect the database...ya know :)
Just escape your single quotes. That's all you need to do. Either use
addslashes() if your database requires quotes to be escaped with a
backslash, or use a str_replace() function if your database requires single
quotes to be escaped with a single quote.
---John Holmes...