<?php
session_start ();
?>
<?php
include ('./config.php');
include ('./banner.php');
?>
<?php
if(!isset ($_SESSION ["name"]))
echo "Sie müssen angemeldet sein";
else {
$content = $_GET ["content"];
$datetime = date('Y-m-d H:i:s');
$public = true;
$pblc = $_GET ["choosepublic"];
$nickname = $_SESSION ["name"];
$handle = mysql_connect ($server, $MYSQL_NAME, $MYSQL_PASSWORD);
$content = htmlentities(mysql_real_escape_string ($content, $handle));
$pblc = htmlentities(mysql_real_escape_string ($pblc, $handle));
$nickname = htmlentities(mysql_real_escape_string ($nickname, $handle));
if (strcmp ($pblc, "privat") == 0)
$public = 0;
else
$public = 1;
if (strlen ($content) > 0) {
mysql_query ("USE " . $databasename, $handle);
mysql_query ("INSERT INTO postings VALUES (\"" . $nickname . "\",\"" . $content . "\",\"" . $datetime ."\",\"" . $public . "\")", $handle);
mysql_close ($handle);
}
}
?>
<script>
window.location = "./thread.php";
</script>