而不是处理PHP的代码,它将其显示为注释

时间:2014-04-07 15:40:28

标签: php html css

我的PHP代码有问题。而不是显示处理此代码,它将此代码视为注释。其他代码部分正常工作,只有这一部分没有。第二个有趣的事情是,当我写?php 而不是时,网站甚至没有将此代码显示为评论。可能是什么原因?

<?
    if (((isset ($_GET ["leaf"]))
    && ($_GET ["leaf"] != "news0"))
    || (!isset ($_GET ["leaf"])))
        {
        echo "<a class=\"tuco\" href=\"?node=news&amp;leaf=news0\">";
        }
    else
        {
        echo "<strong><a class=\"tuco\" href=\"?node=news&amp;leaf=news0\">";
        }
    echo "erstellen";
    if (((isset ($_GET ["leaf"]))
    && ($_GET ["leaf"] != "news0"))
    || (!isset ($_GET ["leaf"])))
        {
        echo "</a>";
        }
    else
        {
        echo "</a></strong>";
        }
    echo " | ";
    if (((isset ($_GET ["leaf"]))
    && ($_GET ["leaf"] != "news1"))
    || (!isset ($_GET ["leaf"])))
        {
        echo "<a class=\"tuco\" href=\"?node=news&amp;leaf=news1\">";
        }
    else
        {
        echo "<strong><a class=\"tuco\" href=\"?node=news&amp;leaf=news2\">";
        }
    echo "l&#246;schen";
    if (((isset ($_GET ["leaf"]))
    && ($_GET ["leaf"] != "news2"))
    || (!isset ($_GET ["leaf"])))
        {
        echo "</a>";
        }
    else
        {
        echo "</a></strong>";
        }?>

Screen

1 个答案:

答案 0 :(得分:3)

您的php.ini已禁用PHP短标记。更改php.ini以处理短标记:

How to enable PHP short tags

此致