I understand if I create an html form with the action attribute set to a PHP script, I can access the POST data via the super global $_POST. My question is how does this happen?
If I have a simple form like this:
<form action="script.php" method="POST">
<input type="text" name="fname">
<input type="submit" value="Submit">
</form>
And a simple script like this:
<?php
echo $_POST["name"];
?>
What mechanism brings the raw form data from the POST request into PHP? Is there some sort of CGI Script? What would the equivalent be for another language, say Ruby?