Caustion Noob question: If and If statements?

Discussion in 'PHP' started by kingjacob, Oct 22, 2007.

  1. #1
    I am trying to write an If and If statement with PHP

    Heres what I got so far:
    <?php if(function_exists('ns_show_top_commentators') ) and (is_home()) { ?>

    I keep getting errors, so can you do if and statements with php and if so where am I fudging it?
     
    kingjacob, Oct 22, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    
    
    <?php
    
    if (function_exists('ns_show_top_commentators') and is_home())
    {
    
    ?>
    
    Content here
    
    <?php
    }
    ?>
    
    
    PHP:
     
    nico_swd, Oct 22, 2007 IP
    kingjacob likes this.
  3. Lordy

    Lordy Peon

    Messages:
    1,643
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #3
    yes you opened your if statement, and then closed it before getting to the and
     
    Lordy, Oct 22, 2007 IP
  4. kingjacob

    kingjacob Peon

    Messages:
    905
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks yall.
     
    kingjacob, Oct 22, 2007 IP