Home  >  Article  >  Backend Development  >  高分问一个简单的<div>问题

高分问一个简单的<div>问题

WBOY
WBOYOriginal
2016-06-23 13:02:04799browse

代码:


内容


本地文件
op.log


如何让我上面的
里显示出我本地文件op.log呢?


回复讨论(解决方案)

不可以!出于安全的考虑,浏览器不让你这么做

如果是php读取服务器本地的文件,可以这样,php文件与op.log放同一目录

<div id="content"><?phpecho file_get_contents('op.log');?></div>


如果是想用js读取客户端的文件,那就不行了,因为没有权限,用flash有机会可以。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn