passing angle brackets in form parameters?

Nick Arnett ([email protected])
Mon, 17 Apr 1995 16:12:32 +0500


Despite access to a wonderful search engine (cough, cough) I just can't
seem to find a definitive answer to the following question...

What is the officially correct, legal way to encode angle brackets in form
parameters?

Let's say, for example, that one wanted to write the following in one's
HTML form:

<INPUT type=hidden name=accessquestion value="vdkvgwkey contains /WWW-talk/">

..but one wanted to surround the word "contains" with angle brackets.
With the browser I'm using, I seem to be required to use the HTML method of
encoding them... to wit:

<INPUT type=hidden name=accessquestion value="vdkvgwkey &lt;contains&gt;
/WWW-talk/">

However, some evil browser out there (I haven't compared the logs to figure
out which) seems to pass the literals to the server, which proceeds to
complain mightily about illegal characters. Actually, the server in
question here is not the Web daemon, it's our search gizmo, but that
doesn't really matter; the client is possibly misbehaving. Or I am.

The Right Thing, of course, is for the client to send an URL that contains
something like this:

&accessquestion=vdkvgwkey+%3Ccontains%3E+%2FWWW-talk%2F

What should the HTML look like?

Nick