Thu, 16 Sep 2004

Windows XP Service Pack 2 breaks form submissions in ShellExecute URLs
Anyone who writes Windows applications that launch URLs by calling the ShellExecute API function will be interested to hear that, beginning with the recently released Windows XP Service Pack 2, it is no longer possible to include a query string in the URL. That is, the following call won't do what you expect:
ShellExecute(hwnd,
	"open",
	"http://somewhere.com/something.php?name=jane&password=isthequeen",
	0,
	0,
	SW_SHOWNORMAL);
In earlier versions of Windows, this call will open the specified URL in the user's preferred web browser application, complete with the query string. In Windows XP Service Pack 2, the ? and everything after it is deleted.

You can work around this by passing your arguments as part of the path. For instance:

http://somewhere.com/something.php/user=jane/password=isthequeen
Apache, and most other web servers with the rumored exception of Microsoft Internet Information Server, are smart enough to recognize that something.php should still be run in this case and will place the rest of the path in the $path_info variable in your PHP script. You can then split this string apart and parse the individual arguments. I have done something similar to maintain support for hassle-free logins to the internal web server of Wusage 8.0.
Posted at: 20:00 0 comments

Comments

Your Comment

HEY SPAMMER! We use Google's nofollow feature. Search engines will NOT follow your link. And we'll delete it anyway. Save my time and yours. Thank you.

 
Name:
URL/Email: [http://... or mailto:you@wherever] (optional)
Title: (optional)
Comment:
Save my Name and URL/Email for next time
Captcha: To prevent comment spam, please retype the characters in this image:

Enter the text here: