Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

semicolon - cgi

Status
Not open for further replies.

o4u

Programmer
Jul 16, 2002
2
HU
The multiple select in WML always separates the values
with ";" . URL is /cgi-bin/search.py?l=e&k=ar;ze;ho&c=bp&d=1
How can I hand over semicolons from the url to a python cgi script to use the values in a sql query. The problem is that only the first comes over (k=ar) from the key k, because of the ";" in the URL.
I have already tried to send by post and get method, to hand over $(var:escape), putting some char to the end of the option value to make the ";" the part of & # x 58(;).
Neither of them works!
Thank you in advance.
Otto
 
Hmm, you could probably do what is normally done with characters like åäö and such, translate them into %xx where xx is the hexadecimal character code for the character.

This is a bit of a hassle but WML will probably skip them if you do.

It might even be the case that they will be automatically parsed back to ';' when passed to your cgi-script actually, depends on how you get them I guess. I believe the hex code for ';' is 3b.
 
Thank you for yor answer!
The semicolons comes from the wml language(specification). If I use the select (multiple) control element, the wml separates the selected values with ";". I can't change it and when I use the filled variable to make a link I get this
href="Why does the cgi.FieldStorage() cut off (in this case) the bike and tram after the ";", but that the strange thing so I can get the value of s.
I know ";" is a reserved character in URI, but maybe there is a trick or I can get every values somehow from the class what is in connection with FieldStorage.
Thanks, Otto
 
Hmm, do you have any control over the stuff that gets put into the url? If you do you can always quote all the ; characters to %3B I believe you will get it correctly to your script.

I'm using a package called quixote right now to do CGI scripting in python that has some nice features and functions. One is the url_quote() which takes a string and quotes it so that you can send it as a paremeter via the URL without having the browser interpret it as some weird part of the URL.

If you want to check it out quixote is located at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top