The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

How do I escape an equals sign in a URL?

I have a tracking code that uses equal signs to capture the edition number and page address in a URL. Problem is a URL that has an equal sign - everything after the URL is dropped because PHP thinks it's a variable - but it's not. How do I escape it?

That link contains a query value which has an equal sign. The URL itself does not have an equal sign in it! Any value after the "?" is a query value and can be retrieved using the $_GET variable with the proper index.

Computers and Fire ...
In the hands of the inexperienced or uneducated,
the results can be disastrous.
While the professional can tame, master even conquer.

I am only using the $_GET variable for "issue" and "url" - but when this goes from the email to my PHP page the URL ends after "siteurl" - no "=sales" because my PHP thinks it's a variable but it's not mine so I want it left intact.

Have you tried the parse_url() function ? You can specify the "PHP_URL_QUERY" parameter and get the query fragment as a string. You can then use the explode function and parse out the url value yourself. Oh by the way, if the parse_url() function returns a false this would indicate a malformed url. Should this be the case you might want to rethink your query value structure.

Computers and Fire ...
In the hands of the inexperienced or uneducated,
the results can be disastrous.
While the professional can tame, master even conquer.