Do you have code to go along with it? I would love to help, but without seeing what is going on, I can't deduce what your problem is.
My guess would be, you're not surrounding the url in quotes. But that wouldn't seem right.
Have you tried:
-- Replace "&" with "&"
-- Write the URL to a variable(s)
-- Researched url_encode();
urlencode
(PHP 3, PHP 4 , PHP 5)
urlencode -- URL-encodes string
Description
string urlencode ( string str )
Returns a string in which all non-alphanumeric characters except -_. have been replaced with a percent (%) sign followed by two hex digits and spaces encoded as plus (+) signs. It is encoded the same way that the posted data from a WWW form is encoded, that is the same way as in application/x-www-form-urlencoded media type. This differs from the RFC1738 encoding (see rawurlencode()) in that for historical reasons, spaces are encoded as plus (+) signs. This function is convenient when encoding a string to be used in a query part of a URL, as a convenient way to pass variables to the next page:
~Brett