comment form logic
Posted: Sun Mar 06, 2005 10:07 pm
i have a comment form in my page, here i limit the appearance of comment form to administrator status only.....now my problem is, if i am an administrator, i have the right to comment the message, i already done this, but i don't want the comment form to appear if i am viewing my own message/thread....here's my code below...
Code: Select all
<?
$uid = $_SESSIONї'userID'];
$query = "SELECT status FROM users WHERE firstname='$fn' and status='administrator'";
$result = @mysql_query($query);
if (mysql_num_rows($result) != 0)
{
$query = "SELECT userID FROM users WHERE userID='$uid'";
$result = @mysql_query($query);
if (!$result)
{
include('commentform.php');
}
else
{
NULL;
}
}
else
{
NULL;
}
?>