Re: Help with '&' character
| From: | Chris Shiflett | Date: | Tue, 17 Feb 2004 19:06:06 +0000 |
| Subject: | Re: Help with '&' character | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-178004@lists.php.net to get a copy of this message | ||
--- Chris Bruce <chris@idextrus.com> wrote:
> I am having trouble with a string becoming truncated at an '&'
> character. I am passing the variable via a link
>
> (http://...&campaign=MBI%20List%20-%20Steel%20&%20Concrete) and then
> when I try to grab the incoming value of campaign into a SELECT query,
> it becomes
>
> SELECT sum(sends) from campaigns where name='MBI List - Steel '
>
> I have tried to urlencode the variable, and also use htmlentities, etc.
> to no avail.
>
> Does anyone have a solution for this?
You already mentioned it: URL encoding.
http://www.php.net/urlencode
There are a lot of user notes on that page. Some of those might also be
helpful.
Chris
=====
Chris Shiflett - http://shiflett.org/
PHP Security - O'Reilly
Coming mid-2004
HTTP Developer's Handbook - Sams
http://httphandbook.org/
PHP Community Site
http://phpcommunity.org/