<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Seasonal madlibs</title>
</head>
<body>
<?
if ( count($_POST)>0 )
{
$place1 = $_POST['place1'];
$person1 = $_POST['person1'];
$thing1 = $_POST['thing1'];
?>
<h1>Your story</h1>
<p>One day, <?=$person1?> went to <?=$place1?> dressed like a <?=$thing1?>.
<?
}
else
{
?>
<h1>Enter the story information</h1>
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">
<table>
<tr><td>place</td><td><input name="place1"></td></tr>
<tr><td>person</td><td><input name="person1"></td></tr>
<tr><td>thing</td><td><input name="thing1"></td></tr>
<tr><td> </td><td><input type="submit"></td></tr>
</table>
</form>
<?
}
?>
</body>
</html>Add a code snippet to your website: www.paste.org