大家好,我想使用 php 创建简单的文件系统。我想使用 php 显示上传文件的内容。但是,当我上传 html 或 php 文件时,将执行 html 或 php 代码,而不是显示其内容。我想显示该文件而不执行。请帮助我。谢谢。
如果 PHP get 被执行,您将包含/需要该文件。请阅读其内容,例如和file_get_contents() http://php.net/manual/en/function.file-get-contents.php 防止浏览器解析 HTML 使用htmlentities() http://php.net/manual/en/function.htmlentities.php