我的PHP代码只是我的html中的一个注释 [英] My PHP code is just a comment in my html

查看:149
本文介绍了我的PHP代码只是我的html中的一个注释的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对不起,这可能很简单,但我现在已经太晚了。我有一个基本的html页面上有一些javascript,当我尝试把任何php在它的身体它读它作为一个注释。

 < html> 
< head>
< link rel =stylesheethref =style.csstype =text / cssmedia =screen>
< script type =text / javascriptsrc =jquery-1.3.2.min.js>< / script>
< script type =text / javascriptsrc =jquery.tablesorter.min.js>< / script>
< script type =text / javascriptsrc =jquery.tablesorter.pager.js>< / script>
< script type =text / javascript>
$(function(){
$(table)
.tablesorter({widthFixed:true,widgets:['zebra']})
.tablesorterPager :$(#pager)});
});
< / script>
< / head>
< body>
< div id =main>
< h1>演示< / h1>

php in here

<?php
echotest php;
?>

...
这里的表的主代码
< / div>
< / body>
< / html>听起来你没有安装PHP,或者你没有安装PHP,或者你没有安装PHP,或者没有安装PHP。您不是使用调用PHP引擎的文件扩展名 - 是您的文件 Blah.php



有些事情需要检查:




  • 您正在从网络服务器(非本地)提供文件

  • 服务器已安装PHP

  • PHP已配置为处理您正在使用的文件类型(通常为.php)

  • 创建新文件只需<?php phpinfo();

  • 如果您有权访问服务器,您应该能够运行PHP从命令行/ shell


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>
    <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?

Some things to check:

  • You're serving the file from a web server (not locally)
  • The server has PHP installed
  • PHP is configured to handle the file type you're using (usually .php)
  • creating a new file with just <?php phpinfo(); ?> and serving it should give you lots of info about your PHP install.
  • If you have access to the server, you should be able to run PHP from the command line/shell

这篇关于我的PHP代码只是我的html中的一个注释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆