Php 如果是语句,则不起作用

Php 如果是语句,则不起作用,php,html,Php,Html,好的,我试图让这个if/else语句解决这个错误: Parse error: syntax error, unexpected T_ELSE 以下是我的if/else声明: <?if ($stats -> totalReferrals($odb, $_SESSION['username']) == '10' or > '10'); {?> <h4><strong>Total Referrals: <font color="green

好的,我试图让这个if/else语句解决这个错误:

Parse error: syntax error, unexpected T_ELSE
以下是我的if/else声明:

<?if ($stats -> totalReferrals($odb, $_SESSION['username']) == '10' or > '10');
  {?>
  <h4><strong>Total Referrals: <font color="green">
<?php echo $stats -> totalReferrals($odb, $_SESSION['username']); ?>
</font></strong></h4>
<?}else{?>
 <h4><strong>Total Referrals: <font color="red">
<?php echo $stats -> totalReferrals($odb, $_SESSION['username']); ?>
</font></strong></h4>
}?>

总转介数:

总转介数:

}?>
如果你能帮我

提前感谢:)

像这样试试

 if ($stats -> totalReferrals($odb, $_SESSION['username']) >= '10')
主要是删除该
在if条件之后。它终止if条件本身。现在代码应该如下

<?php if( $stats->totalReferrals($odb, $_SESSION['username']) >= '10') { ?>
    <h4><strong>Total Referrals: 
          <font color="green">
              <?php echo $stats->totalReferrals($odb, $_SESSION['username']); ?>
          </font>
        </strong>
    </h4>
<?php } else { ?>
    <h4><strong>Total Referrals: 
          <font color="red">
              <?php echo $stats->totalReferrals($odb, $_SESSION['username']); ?>
          </font>
        </strong>
    </h4>
 <?php } ?>

总转介数:

总转介数:


保留此语法…即使您没有将php放在起始标记处,也没有为if语句中的
>

更改为
这个>=那个
它会成功的

删除;在if语句之后

嗯。。。现在它给了我这个错误:
Parse error:syntax error,unexpected$end
好吧,现在我想我得到了:
Parse error:syntax error,unexpected'}
在195=
}上{?>
我终于明白了!谢谢你的帮助!我会给你答案,因为它很有用。使用一些好的源代码编辑器,它会指出语法错误