HTTP POST with *

I

Ike

If I have a field which I am POSTing, and that field is, say, a mathematical
expression such as:

2*8

must I escap the * somehow? what if it is something like:

8 / 2

How can I escape these String values when I POST them, such that the
subsequent page can retrive the original expression? Thanks, Ike
 
J

Jukka K. Korpela

Ike said:
If I have a field which I am POSTing, and that field is, say, a
mathematical expression such as:

2*8

must I escap the * somehow?

The browser will do the necessary escaping (and your form handler has to do
the unescaping, normally by calling a suitable library subroutine).

In practice, "*" won't be escaped; it's a "safe" character.

BTW, 2*8 is just _pseudo_mathematical. In mathematics, the multiplication
sign is either × or a dot operator, for which we can use the middle dot · as
a replacement. The notation 2*8 is just computerese from the ASCII era.
what if it is something like:

8 / 2

Similar considerations apply. In practice, the browser will escape "/" as
"%2F", but you need not worry about this at all. You simply call some
unescape routine in your form handler.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,439
Members
44,829
Latest member
PIXThurman

Latest Threads

Top