Noob - php的工作原理是.php但不是html的一部分 [英] Noob - php works as .php but not when part of html

查看:60
本文介绍了Noob - php的工作原理是.php但不是html的一部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我错过了什么,需要向正确的方向推进。

如果我创建一个包含以下内容的php文件,并通过

调用它浏览器,它按预期工作。

<?php

echo" hello world";

?>


如果我在一个简单的HTML文件中嵌入相同的东西,我什么也得不到。

< html>

< body>

<?php>

echo" Hello world";

?>

< / body>

< / html>


我正在运行

Mandrake 10.0

Apache 2

PHP 4

为Apache加载了php_mod。

我通过内置转速内置的Mandrakes为Apache和PHP安装了

管理系统。


TIA提供任何提示。


Doug

I''m missing something and need a push in the right direction.
If I create a php file with the following content, and call it via a
browser, it works as expected.
<?php
echo "hello world";
?>

If I embed the same thing in a simple HTML file, I get nothing.
<html>
<body>
<?php>
echo "Hello world";
?>
</body>
</html>

I''m running
Mandrake 10.0
Apache 2
PHP 4
The php_mod is loaded for Apache.
I did the install for both Apache and PHP via Mandrakes built in rpm
management system.

TIA for any tips.

Doug

推荐答案

我注意到消息ID:

< zq ******************** @ metrocastcablevision.com >来自dogu包含

以下内容:
I noticed that Message-ID:
<zq********************@metrocastcablevision.com > from dogu contained
the following:
我错过了一些东西,需要朝着正确的方向推进。
如果我创建一个php具有以下内容的文件,并通过
浏览器调用它,它按预期工作。
<?php
echo" hello world" ;;
?>

如果我在一个简单的HTML文件中嵌入相同的东西,我什么也得不到。
< html>
< body>
<?php>
echoHello world;
?>
< / body>
< / html>
I''m missing something and need a push in the right direction.
If I create a php file with the following content, and call it via a
browser, it works as expected.
<?php
echo "hello world";
?>

If I embed the same thing in a simple HTML file, I get nothing.
<html>
<body>
<?php>
echo "Hello world";
?>
</body>
</html>




除非你已经配置了Apache,文件必须以.php结尾

-

Geoff Berrow(把猫放到电子邮件中)

它只是Usenet,没有人死。

我的意见,而不是委员会的,我的。

简单的RFD http://www.ckdog.co.uk/rfdmaker/


我注意到了Messag电子身份证号码:< r8 ******************************** @ 4ax.com>
$ b来自Geoff Berrow的$ b包含以下内容:
I noticed that Message-ID: <r8********************************@4ax.com>
from Geoff Berrow contained the following:
如果我在一个简单的HTML文件中嵌入相同的内容,我什么也得不到。
< ; html>
< body>
<?php>
echo" Hello world" ;;
?>
< / body> < / html>
If I embed the same thing in a simple HTML file, I get nothing.
<html>
<body>
<?php>
echo "Hello world";
?>
</body>
</html>



除非你已经配置了Apache,否则文件必须以.php结尾



Unless you have configured Apache otherwise, the file must end in .php




糟糕。刚注意到错误的''>''


尝试


< html>

< body> ;

<?php

echo" Hello world";

?>

< /身体>

< / html>


-

Geoff Berrow(把猫放到电子邮件中)

它只是Usenet,没有人死。

我的意见,而不是委员会的,我的。

简单的RFD http://www.ckdog.co.uk/rfdmaker/


Geoff Berrow写道:
Geoff Berrow wrote:
我注意到了Message-ID:< r8 *******************来自Geoff Berrow的*************@4ax.com>
包含以下内容:

I noticed that Message-ID: <r8********************************@4ax.com>
from Geoff Berrow contained the following:

如果我在一个简单的HTML文件中嵌入相同的东西,我什么也得不到。
< html>
< body>
<?php>
echo" ; Hello world" ;; ?>
< / body>
< / html>
If I embed the same thing in a simple HTML file, I get nothing.
<html>
<body>
<?php>
echo "Hello world";
?>
</body>
</html>



除非您已配置Apache,否则该文件必须以.php结尾



Unless you have configured Apache otherwise, the file must end in .php



哎呀。刚注意到一个错误的''>''

< html>
< body>
<?php
echoHello world;
?>
< / body>
< / html>


Oops. Just noticed an erroneous ''>''

try

<html>
<body>
<?php
echo "Hello world";
?>
</body>
</html>



谢谢,但是我posted是一种类型 - 在我的实际代码中,<?php line

与你的相同。


除非你有什么意思''配置Apache否则......''?我打赌这是问题,但不知道配置什么。


任何提示都会受到赞赏。


Doug


Thanks, but what I posted was a type - in my actual code, the <?php line
is identical to yours.

What do you mean ''unless you have configured Apache otherwise...''? I
bet that''s the problem but don''t know what to configure.

Any tips would be appreciated.

Doug


这篇关于Noob - php的工作原理是.php但不是html的一部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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