从 Internet 浏览器检查元素时如何在服务器上找到 .php 代码和文件?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7183070/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 02:12:04  来源:igfitidea点击:

How to locate .php code and file on the server when inspecting elements from an internet browser?

phpbrowserfirebuginspect

提问by Arthur Mamou-Mani

When I inspect an element of my webpage using Firebug, I cannot identify which .php code it using and on which php file I can find this code on from the server. Is there any other way to locate pieces of php codes from a browser?

当我使用 Firebug 检查网页的某个元素时,我无法确定它使用的是哪个 .php 代码,以及我可以在哪个 php 文件中从服务器上找到此代码。有没有其他方法可以从浏览器中定位 php 代码片段?

Many thanks,

非常感谢,

Arthur

亚瑟

采纳答案by Gustav

You could edit the source code to make print out. Maybe a HTML comment such as:<!-- Start of index.php -->

您可以编辑源代码以进行打印。也许是一个 HTML 注释,例如:<!-- Start of index.php -->

I actively work to hide what PHP-file is used to generate any specific HTML-output as it makes out a serious security threat.

我积极努力隐藏用于生成任何特定 HTML 输出的 PHP 文件,因为它构成了严重的安全威胁

回答by ddinchev

Look at the address bar of the browser. Firebug inspect works for the current browser page and it doesn't know what PHP is - it's just HTML content, regardless of the script running on the server that generated the content.

查看浏览器的地址栏。Firebug 检查适用于当前浏览器页面,它不知道 PHP 是什么——它只是 HTML 内容,而不管生成内容的服务器上运行的脚本如何。

If this doesn't help, elaborate your question.

如果这没有帮助,请详细说明您的问题。

回答by gnur

If this were possible it would make php less secure, a part of the security is the obscurity, if you could simple find out which file does what it would be much easer to launch a targeted attack.

如果这是可能的,它会降低 php 的安全性,安全性的一部分是默默无闻,如果你能简单地找出哪个文件做了什么,发动有针对性的攻击会容易得多。