Including /excluding an include statement based on the value of a variable
On an index page, I have this:
include "commentformonoff.php";
I would like to modify it so that this inclusion is only done if a variable $countcomments
is equal to 99 or less. If $countcomments
is equal to 100 or more, I would like to echo开发者_运维问答 a message that says "Comments closed."
How can I do this?
Thanks in advance,
John
if($countcomment < 100)
{
include "commentformonoff.php";
} else {
echo "Comments Closed";
}
精彩评论