php脚本在html页面中注释掉了 [英] php script commented out in html page

查看:100
本文介绍了php脚本在html页面中注释掉了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

test.html

===========

test.html
===========

<html>
<head>
    <title>Get web visitor's location</title>
    <meta name="robots" value="none" />
</head>
<body>
<div id="yourinfo">
<? php echo 'hello'; ?>
</div>
</body>
</html>



=== ===============
网页浏览器中的
文件输出:


==================
file output in web browser:

<html><head>
    <title>Get web visitor's location</title>
    <meta name="robots" value="none">
</head>
<body>
<div id="yourinfo">
<!--? php echo 'hello'; ?-->
</div>

</body></html>



== ==============================

请帮我解释为什么php脚本在html文件中被注释掉?



Godaddy Windows主机正在使用.. !!!


================================
please help me why php script is comment out in html file?

Godaddy Windows hosting is in use..!!!

推荐答案

首先,因为你的文件扩展名为html(test.html),Web服务器不会像PHP那样处理。 PHP文件需要扩展名 .php 如果不是php2或php3,如果你正在使用它们。



其次,我相信你有一个带有问号的开头标记和单词php之间的空格。这些应该完全如



First, because your file has extension "html" (test.html) the web server will not process as PHP. PHP files need to have extension .php if not php2 or php3 if you're using those.

Second, I believe you have a space in between the opening tag with question mark and the word "php". Those should be altogether as in

<?php    ... code ... ?> 


这篇关于php脚本在html页面中注释掉了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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