function printform()
{
$poemtitle = $_REQUEST["poemtitle"];
$poemtitle = stripslashes($poemtitle);
$poemcategory = $_REQUEST["poemcategory"];
$poemforeword = $_REQUEST["poemforeword"];
$poemforeword = stripslashes($poemforeword);
$poempoem = $_REQUEST["poempoem"];
$poempoem = stripslashes($poempoem);
?>
}
$poemsubmitted = $_REQUEST["poemsubmitted"];
if ($poemsubmitted == true)
{
$poemtitle = $_REQUEST["poemtitle"];
$poemtitle = addslashes($poemtitle);
$poemcategory = $_REQUEST["poemcategory"];
$poemforeword = $_REQUEST["poemforeword"];
$poemforeword = addslashes($poemforeword);
$poempoem = $_REQUEST["poempoem"];
$poempoem = addslashes($poempoem);
$errors = 0;
if ($poemtitle == "") { $errors++; $errormsg .= " - Your poem must contain a title.
"; }
if ($poemcategory == "") { $errors++; $errormsg .= " - You must select a category.
"; }
if ($poempoem == "") { $errors++; $errormsg .= " - Your poem must contain a, uh, poem.
"; }
if ($errors == 0)
{
$userid = $GLOBALS["TBTUSERID"];
$timestamp = time();
$date = date('j/m/Y', $timestamp);
$time = date('H:i:s', $timestamp);
// 28/07/2003 03:52:46
include("$opendatabase");
$query = "INSERT INTO `thebutt_tbtv4`.`tbt_poetry` (`p` , `id` , `category` , `title` , `foreword` ,
`poem` , `timestamp` , `date` ,`time` ,`hitspoem` ,`moderator`)
VALUES (NULL , '$userid', '$poemcategory', '$poemtitle', '$poemforeword', '$poempoem', NOW( ) , '$date', '$time', '0', '')";
$result = mysql_query($query) or die("ERROR: Couldn't add your poem to the database because:
" . mysql_error());
echo "
Your poem has been submitted!
";
echo "
Thank you for contributing to The Buttered Toast
";
}
else
{
echo "
Submission Error
";
echo "
$errormsg ";
printform();
}
}
else
{
printform();
}
?>