What is going on with Ampersand? &

Soldato
Joined
12 Jan 2004
Posts
3,172
Location
Brighton
Seriously, seems to act really weird.

As a piece of text, it is perfectly valid. However, in a web page, as a "non-standard" character, I convert it from & into & as I am supposed to.

So...

Internal to a database I have a category "Buns & Baps". I decide to convert the "&" into "&" and put that instead.

I'd expect when I post a link with "index.php?category=Buns&Baps" for it to return a value of "Buns%20&%20Baps" for the value of category, however, it seems that the standard behaviour for a browser is to parse the & into a & and then not do the reverse when passing it back, which means that "Baps" is converted into a new variable instead of the end of the first...

Why?? And how can you post "Buns & Baps" as a GET post index.php?category=Buns & Baps (obviously space will be replaced by %20).

EDIT : And just seen, even if using & it will STILL fail and become parsed as a new variable... just nuts.

EDIT : Sorry, my own stupid fault, should have checked up on standards for URLS (http://www.rfc-editor.org/rfc/rfc1738.txt) and HTML (http://www.blooberry.com/indexdot/html/tagpages/text.htm).

Simply converted the URL links to use hex codes to solve.
 
Last edited:
Soldato
OP
Joined
12 Jan 2004
Posts
3,172
Location
Brighton
Clarkey said:
buns and baps eh, what kind of website is this :p

It was an example :D

No need to over analyse why people give the examples they do. During my graphics course, the lecturer decided the Scene for our ray tracer, would be an enormous cylinder, with a sphere at the end, with two spheres at the bottom, then projected it onto a 10 meter screen in front of the class.
 
Man of Honour
Joined
31 Jan 2004
Posts
16,335
Location
Plymouth
Shoseki said:
Hey I am sure there is an enormous joke in there somewhere. Enormous.
You're doing it again! You're telling him off for over-analysing in a completely over-the-top way :p There wasn't really any need for the put-down of "No need to over analyse why people give the examples they do." :p
 
Back
Top Bottom