<?php
// Fix for PHP Versions < 4.1.0
// You can remove this if the server is running PHP 4.1.0+
if (!isset($SERVER))
{
$SERVER=$HTTP_SERVER_VARS;
$_SERVER=$HTTP_POST_VARS;
}
// If the RequestMethod is POST, then the form has been submitted
if ($SERVER['REQUEST_METHOD']=='POST')
{
// Validate form, make sure the name is set and not empty
if ((isset($POST['name']) && (!empty($_POST['name']))
{
// If all is well, jump to the new page
header ('Location: valid.php');
exit();
}
else
{
// If all is not well print an error message;
echo "You must provide a name";
}
}
// Display the form here - make sure the form's method is POST.
?>