Archive: ExecShell problem


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?


escape the " maybe, ...?foo%22bar


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.

Not using IE (ever) . Using Firefox.


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.


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