如何用php连接文件夹中的html

时间:2016-02-14 09:46:00

标签: php

我正在尝试连接 文件夹中的php文件: “localhost”到“localhost / folder” 但它总是说:“找不到物体!”

<a href='file://localhost/folder/narudzba.html'></a>

我需要改变什么?

2 个答案:

答案 0 :(得分:2)

试试这个

<a href='/folder/narudzba.html'></a>

答案 1 :(得分:2)

我假设您使用的是http服务器。在这种情况下,您应该使用协议file而不是<a href='http://localhost/folder/narudzba.html'></a> 。因此,您的链接应如下所示:

<a href='/folder/narudzba.html'></a>

或者像 @paranoid 所说,如果你想使用相对路径,就像下面一样,这通常是一个更好的解决方案:

<a href='http://localhost:82/folder/narudzba.html'></a>

编辑:由于您没有使用默认服务器端口80,请尝试此解决方案:

{{1}}