开发者

PHP conditional on query string with id

开发者 https://www.devze.com 2023-02-13 05:38 出处:网络
I have this code: if(\'open\' == $po开发者_Python百科st->comment_status || !isset($_GET[\'wp_accept_favor\']))

I have this code:

    if('open' == $po开发者_Python百科st->comment_status || !isset($_GET['wp_accept_favor']))
    {

// show comment form

    }
else
{
    // dont show comment form
    }

domain.com/?wp_accept_favor then show comment form

domain.com/?wp_accept_favor=2 then dont show comment form

How do I do that? Thanks


if('open' == $post->comment_status || 
             (isset($_GET['wp_accept_favor']) && empty($_GET['wp_accept_favor'])) )
{

    // show comment form

}
else if(isset($_GET['wp_accept_favor']) && !empty($_GET['wp_accept_favor']))
{
    // do not show comment form 
}
0

精彩评论

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