IE 8 fixes submit button bug

Sometimes when you submit a form, you may wanna disable the submit button. (e.g. When the user is posting a order / payment).

The first idea popped up in my head was like this:

 
 
 
 
<form action="http://www.google.com/search">
<input name="q" type="text" />
<input onclick="this.disabled=true; window.alert('test');" type="submit" />
</form>

Actually I was using similar code in a real life application for a client. Then he told me it can’t work. After a little test I found out that IE 7 won’t submit the form when you disable the submit button. Firefox can handle it properly though.

And as I’m messing around with IE 8, I found they fixed the bug.

To test it, go to http://playground.softboysxp.org/post_test.html , type something and hit the button. You should see a message box, then the query will be submitted to Google. While in IE7, the form won’t get submitted.

PSP Internet Browser HTTP Headers

I remember visiting a PSP-only website, which when browsed on PC, gives a different output saying something like “you should view this on PSP”. I wonder how they implemented it.

I guess PSP must send some kind of special info to the server, so I wrote a little PHP script showing request headers. (traditional sniffers / browser plugins won’t work now, unless you wanna port them to PSP yourself, lol).

As my hosting does not allow apache_request_headers, I have to extract the data from $_SERVER myself.

<?php
foreach ($_SERVER as $k => $v) {
	if (substr($k, 0, 5) == "HTTP_") {
		// Format the variable names
		$k = str_replace('_', ' ', substr($k, 5));
		$k = str_replace(' ', '-', ucwords(strtolower($k)));
 
		echo "<tr><td class=\"e\">$k</td><td class=\"v\">$v</td></tr>\r\n";
	}
}
?>

You can point your PSP to http://playground.softboysxp.org/show_request_header.php and test it yourself.

Here’s a snapshot taken on my PSP

Clearly, there are two PSP-specific variables, x-psp-browser and x-psp-productcode. Also notice that the User-Agent was set to reflect PSP’s browser.

Further Research

I googled x-psp-browser and found this document by SCE.

Guidelines for Creating Content for the “PSP” Internet Browser (Japanese)

User-Agent by far can only be “User-Agent: Mozilla/4.0 (PSP (PlayStation Portable); 2.00)

x-psp-productcode represents the region of your PSP and can be one of the following

Region Code
開発ツール (Development Tools) “TOOL”
日本 (Japan) “J1”
北米 (North America) “UC2”
東欧/欧州 (Europe) “CEL”
韓国 (Korea) “KR2”
UK (United Kingdom) “CEK”
メキシコ (Mexico) “MX2”
AU/NZ (Australia/New Zealand) “AU3”
南アジア (South Asia) “E12”
台湾 (Taiwan) “TW1”
ロシア (Russia) “RU3”
中国 (China) “CN9”

x-psp-browser is in the format of “n.nn (xxx; yyy; zzz; …)”
n.nn is the version of the firmware
xxx, yyy, zzz … being parameters, specify from where the browser was lunched, with LX for XMB, SX for applications under XMB, and LU being applications on UMD or Memory Stick. Another parameter, “system”, specifies the version.

Another variable, x-psp-application can be used to specify the name of the game/application, when the browser was launched by an application on UMD/Memory Stick.

Oh hai I’m back

Yup that’s right I’m back on the blogging field, XD.

Actually I know the chance ppl actually reading this blog is one of a billion. But everyone loves publishing, such is the human nature.

Plus this site gives me a place to host my various pics, video clips, files, etc. for my posts on forums. No need to find a public file hosting any more ! 5G Storage / 250G bandwidth is more than enough for me. So far I’m very satisfied with my hosting provider.

P.S. Good to see you again, WordPress, xD.