A simple PHP-script that evaluates the above form (PHP)

When the user pushes the ``Ready''-button in the above HTML-Page a script dante.php3 is called. In our example we assume that the script is written in PHP (see section 1.3.2). A documentation for PHP can be found on their homepage.

One important variable that will be defined is $POEM that contains the user's input. The following script shows how this input can be stored in a plain text file.

<html>
<head>
</head>
<body>
Thank you for contributing<P>
<?
   $fd = fopen ("verse.txt","a");
   fwrite($fd,"$POEM\n");       
   fclose ($fd);
?>
</body>
</html>

The PHP-function fopen opens a file, fwrite writes into the file, and fclose closes the file again.



Oliver Kirchkamp 2013-04-15