<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Updating . . .</title>
<link rel="stylesheet" type="text/css" href="style.css" />
<style type="text/css">
<!--
#updatebox {
background-color: #D2CCCA;
border: 2px solid #000;
padding: 10px;
font: 10px;
height: 100px;
width: 200px;
position: absolute;
	top: 40%;
	left: 40%;
text-align: center;
}
-->
</style>
</head>

<body>
<div id="updatebox">
<p>Updating...</p>
<?php
$dbh = mysql_connect ("localhost", "eclecti_site", "eclectic") or die (mysql_error());
mysql_select_db ("eclecti_site");

if (empty ($SUBJECT) OR empty ($ENTRY) OR empty ($password)) {
	echo "Fill in all the forms next time.";
}
else {
	if (strtolower ($password) === "eclectic") {
		$query = "INSERT INTO `news` 
			( `DATETIME` , `SUBJECT` , `ENTRY` ) 
			VALUES ( '" . date ("Y-m-d H:i:s") . "' , '" . $SUBJECT . "' , '" . $ENTRY . "' );";
		$mysql = mysql_query ($query, $dbh);
		if ($mysql) {echo "<br /><p>Sucess!</p>";}
		else {echo "<br /><p>Failure</p>";}
	}
}
?>
</div>
</body>
</html>