AJAX data converter

<?php
 
if (!isset($_POST["what"])){
?>
<html>
  <head>
    <script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js"></script>
 
    <script type="text/javascript">
function decode(form){
	$("#answer").fadeOut("slow", function () {
		$.post("converter.php", { what: form.what.options[form.what.selectedIndex].value, data: form.data.value },
		function(data){
			document.getElementById("answer").innerHTML = data; 
			$("#answer").fadeIn("slow");
		});
	});
}     
    </script>
  </head>
  <body>
	<form>
	Data:<br/>
	<textarea name="data" rows='8' cols='64'></textarea><br/>
	<select name="what">
		<option value="base64_decode">base64_decode</option>
		<option value="base64_encode">base64_encode</option>
		<option value="urldecode">urldecode</option>
		<option value="urlencode">urlencode</option>
		<option value="htmlspecialchars_ decode">htmlspecialchars_ decode</option>
		<option value="htmlspecialchars">htmlspecialchars</option>
		<option value="convert_uuencode">convert_uuencode</option>
		<option value="convert_uudecode">convert_uudecode</option>
		<option value="str_rot13">str_rot13</option>
		<option value="md5">md5</option>
		<option value="sha1">sha1</option>
		<option value="sha256">sha256</option>
		<option value="sha384">sha384</option>
		<option value="sha512">sha512</option>
		<option value="crc32">crc32</option>
		<option value="crc32b">crc32b</option>
		<option value="csr">csr</option>
		<option value="x509cert">x509cert</option>
		<option value="unixtime">Unix Timestamp to Date</option>
		<option value="datetime">Date to Unix Timestamp</option>
	</select>
	<input type='button' onClick="decode(this.form);" value="Go!"/>
	</form>
	<div id='answer'>Result</div>
 
  </body>
</html>
<?php
} else {
	print "<PRE>";
	switch($_POST["what"]){
		case "base64_decode":
			print base64_decode($_POST['data']);
			break;
		case "base64_encode":
			print base64_encode($_POST['data']);
			break;
		case "urldecode":
			print urldecode($_POST['data']);
			break;
		case "urlencode":
			print urlencode($_POST['data']);
			break;
		case "htmlspecialchars_ decode":
			print htmlspecialchars_decode($_POST['data']);
			break;
		case "htmlspecialchars":
			print htmlspecialchars($_POST['data']);
			break;
		case "convert_uuencode":
			print convert_uuencode($_POST['data']);
			break;
		case "convert_uudecode":
			print convert_uudecode($_POST['data']);
			break;
		case "str_rot13":
			print str_rot13($_POST['data']);
			break;
		case "md5":
			print hash("md5",$_POST['data']);
			break;
		case "sha1":
			print hash("sha1",$_POST['data']);
			break;
		case "sha256":
			print hash("sha256",$_POST['data']);
			break;
		case "sha384":
			print hash("sha384",$_POST['data']);
			break;
		case "sha512":
			print hash("sha512",$_POST['data']);
			break;
		case "crc32":
			print hash("crc32",$_POST['data']);
			break;
		case "crc32b":
			print hash("crc32b",$_POST['data']);
			break;
		case "csr":
			print_r(openssl_csr_get_subject($_POST['data']));
			print_r(openssl_pkey_get_details(openssl_csr_get_public_key($_POST['data'])));
			break;
		case "x509cert":
			print_r(openssl_x509_parse($_POST['data']));
			break;
		case "unixtime":
			date_default_timezone_set("America/Montreal");
			print date("Y-m-d H:i:s", $_POST['data']); 
			break;
		case "datetime":
			date_default_timezone_set("America/Montreal");
			print strtotime($_POST['data']);
			break;
		default:
			print $_POST['data'];
			break;
	}
	print "</PRE>";
}