[英]My PHP code is just a comment in my html
Sorry guys this is probably pretty simple, but i've been up way too late now. 对不起,伙计们这可能很简单,但我现在已经太晚了。 I have a basic html page with some javascript on it, and when i try to put any php in the body it reads it as a comment. 我有一个基本的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>
Sounds like you either don't have PHP installed or you're not using a file extension which invokes the PHP engine - is your file called Blah.php
? 听起来你要么没有安装PHP,要么你没有使用调用PHP引擎的文件扩展名 - 你的文件名为Blah.php
吗?
Some things to check: 有些事要检查:
<?php phpinfo(); ?>
用<?php phpinfo(); ?>
创建一个新文件<?php phpinfo(); ?>
<?php phpinfo(); ?>
and serving it should give you lots of info about your PHP install. <?php phpinfo(); ?>
和服务就应该给你很多关于你的PHP安装信息的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.