如何在HTML中运行PHP?

| 如果我在与index.html相同的目录中有一个文件file.php: file.php:
<?php
echo \"<body><img src=\\\"hi.jpg\\\" /><br /><p>I was here</p>\"
?>
index.html:
<html>
<head></head>
<!-- I want to enter the PHP in file.php here --></body>
</html>
如何将file.php放在index.html中?     
已邀请:
        将
index.html
重命名为
index.php
,并填写以下内容:
<html>
<head></head>
<?php
require(\'./file.php\');
?>
</html>
    
        这为我工作: 将以下内容添加到您的.htaccess文件中
AddType application/x-httpd-php .php .htm .html
AddHandler application/x-httpd-php5 .html .php .htm
    

要回复问题请先登录注册