链接到 xampp/Apache 中的本地 php 文件


Link to a local php file in xampp/Apache?

在我的php脚本中,如何链接到另一个文件?地址应该是什么?如果它在托管服务器上,那就很简单了。例如

Echo File_get_contents ('foldername/test.php'); 

test.php 位于默认文件夹中

我试过 http://localhost/test.php

我的错。

我将文件名保存为

文件名.htm

所以实际文件名是

文件名.htm.htm

直到我点击属性,我才意识到这一点。php 代码中的路径很简单

文件名.htm