faqts : Computers : Programming : Languages : PHP : Common Problems : Forms and User Input : URLs and Post or Get Methods

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

14 of 23 people (61%) answered Yes
Recently 4 of 10 people (40%) answered Yes

Entry

How can I pass an ampersand (&) in a url?

Jun 19th, 1999 07:00
Nathan Wallace, Onno Benschop, Rasmus Lerdorf, Nathan Wallace


The ampersand character is used in get requests to separate the
arguments:

http://www.example.com/foo.php3?var1=foo&var2=bar

That means that things don't work very well if you try to include an
ampersand in one of the actual arguments that you are passing.

You should always urlencode any arguments that you are passing that may
contain problem characters.

http://www.php.net/manual/function.urlencode.php3