<?php
	session_start();
	$link = mysqli_connect("localhost","root","","taschenrechner") ?: die("Öhm, MySQL will nicht verbinden.".mysqli_connect_errno());
	isset($_POST["action"]) ?: $_POST["action"]="";	
	strlen($_POST["action"])<=5 ?: die("Das tat weh :'C");
	$query = "SELECT input('".session_id()."','".$_POST["action"]."')";
	$result = mysqli_query($link, $query) ?: die("Öhm, MySQL mag die Query nicht.".mysqli_error());		
	echo implode("",mysqli_fetch_row($result));
	unset($_POST["action"]);
	mysqli_free_result($result);
	mysqli_close($link);
?>
