Easiest way in PHP is to use GET/POST as data-in and echo
as data-out.Here's a sample:
<?php if(empty($_GET['method'])) die('no method specified');switch($_GET['method']){ case 'add': { if(empty($_GET['a']) || empty($_GET['b'])) die("Please provide two numbers. "); if(!is_numeric($_GET['a']) || !is_numeric($_GET['b'])) die("Those aren't numbers, please provide numbers. "); die(''.($_GET['a']+$_GET['b'])); break; }}
Save this as test.php and go to http://localhost/test.php?method=add&a=2&b=3
(or wherever your webserver is) and it should say 5
.