开发者

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";
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜