4096){
$postAllowed = false;
echo "Your post is too long. Maximum post size is 4,096 chars.";
}
if(strlen($postName) > 256){
$postAllowed = false;
echo "Your post name is too long. Maximum name size is 256 chars.";
}
// Finally, lets get to the posting.
if($postAllowed == true){
$bbspass = "changeme";
$db = new db($config);
$db->connect();
$newPost = array(
"id" => $db->getPosts()->num_rows+1,
"name" => htmlspecialchars($postName),
"date" => date("Y/m/d g:i:s"),
"reply" => intval($postReply),
"board" => $postBoard,
"post" => htmlspecialchars($postText),
"info" => crypt($_SERVER['REMOTE_ADDR'], $bbspass), // used for IP banning people without storing their ip as plaintext
"style" => "normal",
"fortune" => "none",
"roll" => "none",
"admin" => "none"
);
$new = $newPost;
echo $db->addPost($new);
header("Location: index.php");
} else {
echo "not allowed";
}
?>