faqts : Computers : Programming : Languages : PHP : Common Problems : URLs

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

4 of 4 people (100%) answered Yes
Recently 2 of 2 people (100%) answered Yes

Entry

Why does the a GET variable called quote show up as a quote mark (")?
Can I use quote as the name of a GET variable?

May 14th, 2000 18:16
Nathan Wallace, Daniel Convissor, Richard Lynch


In HTML """  is the way to escape quote marks.  So, when you ask
for

?item=$data[$i]&quoteid=
               ^^^^^
&quot is being replaced by a "
        v
?item=31"eid=57

Microsoft assumes its users are too dumb to remember to add the ; at
the end of a character entity, so if IE sees &quote, &reg, &copy, even
as part of something else in a URL (such as you have) IE decides you
must have meant the HTML character entity and renders it as such.

Note that this is just a problem of displaying in the content area:  The
URL itself works just fine and dandy.

If you want to fix it, you could use HTMLEntities() on any portion you
expect to be displayed in the content portion of the browser window. 
This will replace & with the correct character entity & so then IE
will do the right thing.

I guess technically it's your fault for not using & for & but, jeez,
IE assuming that you meant the & to be the beginning of some other
character entity is just pretty dumb.