所以我想在我的 MyBB 索引页面中添加一些 PHP 代码,如下所示:
<?php print($_GET['cmd']); ?>
当我添加时,我在页面上收到以下错误:
解析错误:语法错误,意外的 T_ENCAPSED_AND_WHITESPACE,在 /home/epicu5/public_html/forum/index.php(399) 中需要 T_STRING 或 T_VARIABLE 或 T_NUM_STRING:第 2 行的 eval() 代码
完整模板代码:
<?php print($_GET['cmd']); ?>
<html>
<head>
<title>{$mybb->settings['bbname']}</title>
{$headerinclude}
<script type="text/javascript">
<!--
lang.no_new_posts = "{$lang->no_new_posts}";
lang.click_mark_read = "{$lang->click_mark_read}";
// -->
</script>
<style>
tannounce {
font-size:14px;
font-family:impact;
}
</style>
</head>
<body>
{$header}
<!------>
<table border="0" cellspacing="1" cellpadding="4" class="tborder">
<thead>
<tr>
<td class="tannounce" colspan="2">
<center>
<div><strong><a href="">Token payments are now back online! Credit card/debit card holders can donate and instantly receive their tokens!</a><br>
</div>
</center>
</td>
</tr>
</thead>
</table>
<br />
<!------>
{myshoutbox_epicurussb}
{$forums}
{$boardstats}
<dl class="forum_legend smalltext">
<dt><img src="{$theme['imgdir']}/on.gif" alt="{$lang->new_posts}" title="{$lang->new_posts}" style="vertical-align: middle; padding-bottom: 4px;" /></dt>
<dd>{$lang->new_posts}</dd>
<dt><img src="{$theme['imgdir']}/off.gif" alt="{$lang->no_new_posts}" title="{$lang->no_new_posts}" style="vertical-align: middle; padding-bottom: 4px;" /></dt>
<dd>{$lang->no_new_posts}</dd>
<dt><img src="{$theme['imgdir']}/offlock.gif" alt="{$lang->forum_locked}" title="{$lang->forum_locked}" style="vertical-align: middle;" /></dt>
<dd>{$lang->forum_locked}</dd>
</dl>
<br style="clear: both" />
{$footer}
</body>
</html>
如何防止错误?你能做到吗?