obicharon
4th April 2008 10:30 UTC
ExecShell problem
I have made in my uninstaller some custom pages that collect the reasons for uninstalling the program. The answers are gathered in a string and the string is sent as a GET argument to a web page. The string contains double quotation marks " " .
It is something like this
?motifs="1,2,3"&obs="observation text"
The string is constructed correctly ( i put a message box to display it and contains the quotation marks). The string is passed to a ExecShell instruction like this
ExecShell "open" "http://www.mysite.com/$getString" where get string is the variable that contains the string (displayed with MBox it looks ok).
The Exec is ok, the page in open ,the string is passed as a GET argument but the quotation marks do not appear in the link opened in the browser.
How can i make the marks show?
Anders
4th April 2008 10:34 UTC
escape the " maybe, ...?foo%22bar
GregL
4th April 2008 14:56 UTC
Anders is correct. You are probably using Internet Explorer. It's trying to be "helpful" and it's NOT showing you what it really did behind the scenes.
Quotes get escaped to %22 and technically you'd want their whole string URL encoded, including spaces and ampersands.
?motifs=%221,2,3%22&obs=%22observation%20text%22
Also bear in mind that Internet Explorer has max length URL limit of about 2,048 bytes. Other browsers don't have this limit so you have to code for the lowest common denominator here.
Another option you may want to consider is just launching a page on your site and presenting them with your form. Assuming you're using PHP, or similar language, you'll have much more control over their submission and can avoid some pitfalls doing it this other way.
obicharon
4th April 2008 16:14 UTC
Not using IE (ever) . Using Firefox.
GregL
4th April 2008 17:53 UTC
But many (most?) of your users likely are using IE.
Firefox on my system showed the values after encoding which is why I made the assumption you were using IE.
Afrow UK
4th April 2008 20:24 UTC
This is not just Internet Explorer. You have to encode all characters except for _ - and all alpha-numeric characters. Spaces need to be replaced with + signs.
The encoding is % followed by the ASCII hexadecimal equivalent.
http://www.w3schools.com/TAGS/ref_urlencode.asp
Stu