<?php
/**
* @Author Tarchini Maurizio
* @Version 1.0
* @AuthorEmail hide@address.com or hide@address.com
* @AuthorSite http://www.mtxweb.ch
* @DocumentDate 1-3-2008
* @DocumentLicense PUBLIC -FREE
* @LicenseDetail GNU General Public License
* @LicenseSite http://www.gnu.org/licenses/gpl.txt
* @PHPCompatibility 4.2 or later
* @DevelopmentStatus DIST - beta
*/
include_once "./lib/function_page.php";
include_once "./lib/function_db.php";
Grant();
if ($_POST['controllo'] != "ck")
{
PageIn();
echo '<h1>Area funzioni: REGISTRAZIONE NEWS</h1><br><br>
<h2>Scrivi la tua news</h2>
';
BoxIn(600);
echo '<script language="JavaScript" type="text/javascript" src="./js/wy/wysiwyg.js">
</script>
';
echo "<center><form name=\"content\" method=\"POST\" action=\"news_write.php\">\r\n";
echo "<textarea id=\"textarea1\" name=\"content\" style=\"height: 170px; width: 500px;\"></textarea>\r\n";
echo "<script language=\"javascript1.2\">generate_wysiwyg('textarea1');</script>\r\n";
echo '<input type="hidden" value="ck" name="controllo" /><input type="hidden" value="' . $_GET['id'] . '" name="id" />';
echo "<br><input type=\"submit\" value=\"registra\" class=\"but\">\r\n</form>\r\n</center>\r\n";
BoxOut();
PageOut();
}
else
{
$user = UserX();
$oggi = time();
$sql = "INSERT INTO news (data,user,contenuto,rif) VALUES ('$oggi','$user','$_POST[content]','general')";
QueryExec($sql);
header("Location: news.php");
}
?>