REVCMS Comments

Junior Spellweaver
Joined
Dec 5, 2012
Messages
106
Reaction score
14
I have made a script that if the users have post a comment , so she/he will not be able to post it twice .
And I am asking for helps because this code doesn't works.
Code:
<?php
$checkid = mysql_query ("SELECT id FROM cms_news WHERE id='".htmlentities($_GET['id'])."'");
$posts = mysql_query ("SELECT * FROM site_news_comments WHERE author='" . $_SESSION['user']['username']. "' AND article='{$checkid}'  ");
if($posts = 1 )
{
    define('ERROR', 'Sorry, you are only allowed one comment per article.');
}
if(defined("SUCCESS")){
?>
<div class="rounded rounded-green" width="20%">
                    <?php echo SUCCESS; ?><br />
                </div>
                <div> </div>
<?php
}
if(defined("ERROR")) {
?>
<div class="rounded rounded-red" width="20%">
                    <?php echo ERROR; ?><br />
                </div>
                <div> </div>
<?php
}
else
{
?>
<form action="" method="post">
<textarea name="comment" maxlength="500"></textarea><br /><br />
<input type="submit" name="post_comment" value="Place Comment" />
</form>
<?php
}
?>
 
Last edited:
You edited the OP after I posted that with the
Code:
And I am asking for helps because this code doesn't works.

So it would seem like a help thread. When I first saw this it looked like a release.
 
Upvote 0
Back