【发布时间】:2011-05-10 12:44:20
【问题描述】:
对不起,伙计们,这可能很简单,但我现在起得太晚了。我有一个基本的 html 页面,上面有一些 javascript,当我尝试将任何 php 放入正文中时,它会将其读取为注释。
<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css" media="screen">
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="jquery.tablesorter.min.js"></script>
<script type="text/javascript" src="jquery.tablesorter.pager.js"></script>
<script type="text/javascript">
$(function() {
$("table")
.tablesorter({widthFixed: true, widgets: ['zebra']})
.tablesorterPager({container: $("#pager")});
});
</script>
</head>
<body>
<div id="main">
<h1>Demo</h1>
php in here
<?php
echo "test php";
?>
...
main code for a table here
</div>
</body>
</html>
【问题讨论】:
-
您正在使用服务器来传递这个,对吗?
-
你的意思是它打印为平面文本吗?如果是这样,请确保 PHP 正在您的服务器上运行并正确连接
标签: php javascript html comments