1 2 3 4 5 6 7 8 9 10 11 12
<?php switch ($_SERVER["REQUEST_METHOD"]) { case "GET": echo $_GET["variable"]; break; case "POST": echo $_POST["variable"]; break; default: echo "ERROR!"; } ?>