如何在 HTML 中运行 PHP?
如果我有一个文件 file.php 与 index.html 位于同一目录中:
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 中?
If I have a file, file.php, in the same directory as index.html:
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>
How do I put file.php in index.html?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将
index.html
重命名为index.php
,并填充以下内容:Rename
index.html
toindex.php
, and fill it with the following:这对我有用:
将以下内容添加到您的 .htaccess 文件
This worked for me:
Add the following to your .htaccess file