Running a PHP cgi program 

 The html to prompt for your name looks like this
 
<!DOCTYPE html>
<html>
<body>
<FORM ACTION="/cgi-bin/hello-php.php" METHOD="POST">
<label><b>Please enter your name</b></label>
<INPUT TYPE="text" NAME="person" SIZE=30 >
<input type="submit" value="Submit" />
</form>
</body>
</html>

Note: you can also use javascript to prompt for the name rather than a form
See Javascript example1

The PHP cgi code on the server looks like this

<?php
echo "Hello " . $_POST['person'] ."<br>";
?>

last updated 4 Apr 2016