For some reason I cant post text longer than about 40~ characters..
The code
// remove space
foreach($_POST as $key => $val) $_POST[$key] = trim($val);
// check for empty fields
if (empty($_POST['comment'])) {
header("Refresh: 2; url=$_SERVER[REQUEST_URI]");
exit('<div class="error_msg">You can\'t post a blank message.</div>');
}
// save if no problem
else {
mysql_query("INSERT INTO comments (comment, content, content_id, poster, date)
VALUES('{$_POST['comment']}', 'thread', '$thread_id', '1', NOW())");
header("refresh: 2; url=thread.php?id=$thread_id");
// SUCCESS
}
Db:
`id` int(11) NOT NULL AUTO_INCREMENT,
`comment` text,
`content` varchar(255) NOT NULL,
`content_id` int(11) NOT NULL DEFAULT '0',
`poster` int(11) NOT NULL DEFAULT '0',
`date` datetime NOT NULL
any ideas?
and yes i gonna sanitize the $_post
thanks Tomasz