Leader
github.com/habbo-hotel
- Aug 24, 2012
- 1,031
- 307
Seen that released before, I had to fix it myself. It has two of the same codes or something like that I forgot and it sends two queries to the table so instead of one comment, theres two posted.
Since I cant code php anymore, I say remove
if (! isset($_POST['comment'])) {
$_POST['comment'] = ''; // nu bestaat de variabele ten minste
PHP:
<?php
if(isset($_POST['post_comment']))
$posted_on = date("M j, Y g:i A");
if (! isset($_POST['comment'])) {
$_POST['comment'] = ''; // nu bestaat de variabele ten minste
}
$comment = strip_tags ($_POST['comment']);
if($comment == NULL){
$error_message = 'You have left a field empty.<br /><br />';
}else{
if (LOGGED_IN)
{
mysql_query("INSERT INTO site_news_comments (article, userid, comment, posted_on) VALUES ('".$news_article_id."', '".$_SESSION['id']."', '".$comment."', '".$posted_on."');");
$error_message = 'You have successfully left a comment.<br /><br />';
}
}
?>
if (! isset($_POST['comment'])) {
$_POST['comment'] = ''; // nu bestaat de variabele ten minste