【问题标题】:Weird <!--php tags form database奇怪的 <!--php 标记形成数据库
【发布时间】:2011-09-06 08:33:50
【问题描述】:

当我从数据库中提取数据时,有没有人遇到过这个问题,如下所示,在实际的数据库表中看起来很好。

我正在使用 wordpress。任何让我头疼的建议。

这些是标签

<pre><!--? if (function_exists('externalGetSociofluidButtonsForCurrentUrl'))
                {echo externalGetSociofluidButtonsForCurrentUrl();} ?-->
<!--?php DisplayVotes(get_the_ID()); ?-->
<!--?php MostVotedAllTime(); ?--></pre>

【问题讨论】:

  • 是来自数据库的未序列化数据吗?

标签: php database wordpress formatting


【解决方案1】:

这只是注释掉一些 PHP 代码的一种不好的方式,除了因为它是一个 HTML 引用,原始代码将被发送到客户端。在功能方面:

<pre><?php /* echo "this will not be executed" */ ?></pre>

<pre><!--?php echo "this will not be executed" ?--></pre>

两者都禁用 echo 调用,但 HTML 引用版本会将注释掉的代码发送到浏览器,而使用 /* */ 只会发送 &lt;pre&gt;&lt;/pre&gt;

【讨论】:

    猜你喜欢
    • 2010-12-27
    • 1970-01-01
    • 2017-03-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-12-18
    相关资源
    最近更新 更多