<legend id='N9zqF'><style id='N9zqF'><dir id='N9zqF'><q id='N9zqF'></q></dir></style></legend>

  1. <i id='N9zqF'><tr id='N9zqF'><dt id='N9zqF'><q id='N9zqF'><span id='N9zqF'><b id='N9zqF'><form id='N9zqF'><ins id='N9zqF'></ins><ul id='N9zqF'></ul><sub id='N9zqF'></sub></form><legend id='N9zqF'></legend><bdo id='N9zqF'><pre id='N9zqF'><center id='N9zqF'></center></pre></bdo></b><th id='N9zqF'></th></span></q></dt></tr></i><div id='N9zqF'><tfoot id='N9zqF'></tfoot><dl id='N9zqF'><fieldset id='N9zqF'></fieldset></dl></div>
  2. <tfoot id='N9zqF'></tfoot>

        <bdo id='N9zqF'></bdo><ul id='N9zqF'></ul>
    1. <small id='N9zqF'></small><noframes id='N9zqF'>

    2. 隐藏 PHP 的 X-Powered-By 标头

      Hiding PHP#39;s X-Powered-By header(隐藏 PHP 的 X-Powered-By 标头)

        <tfoot id='bH3Fm'></tfoot>
          <bdo id='bH3Fm'></bdo><ul id='bH3Fm'></ul>

          <small id='bH3Fm'></small><noframes id='bH3Fm'>

              1. <i id='bH3Fm'><tr id='bH3Fm'><dt id='bH3Fm'><q id='bH3Fm'><span id='bH3Fm'><b id='bH3Fm'><form id='bH3Fm'><ins id='bH3Fm'></ins><ul id='bH3Fm'></ul><sub id='bH3Fm'></sub></form><legend id='bH3Fm'></legend><bdo id='bH3Fm'><pre id='bH3Fm'><center id='bH3Fm'></center></pre></bdo></b><th id='bH3Fm'></th></span></q></dt></tr></i><div id='bH3Fm'><tfoot id='bH3Fm'></tfoot><dl id='bH3Fm'><fieldset id='bH3Fm'></fieldset></dl></div>
                <legend id='bH3Fm'><style id='bH3Fm'><dir id='bH3Fm'><q id='bH3Fm'></q></dir></style></legend>
                  <tbody id='bH3Fm'></tbody>
                本文介绍了隐藏 PHP 的 X-Powered-By 标头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我知道在 PHP 中,它发送 X-Powered-By 标头以获得 PHP 版本.

                I know in PHP, it sends the X-Powered-By header to have the PHP version.

                我还知道,通过附加一些校验和,您可以获得 PHP 的积分和一些随机图像(更多信息在这里).

                I also know by appending some checksums, you can get access to PHP's credits, and some random images (more info here).

                我也知道在 php.ini 中你可以关闭 expose_php = off.

                I also know in php.ini you can turn expose_php = off.

                但这是我在几个网站上做过的事情,那就是使用

                But here is something I have done on a few sites, and that is use

                header('X-Powered-By: Alex');
                

                当我查看标题时,我可以看到它现在是Alex"而不是 PHP 版本.我的问题是,这是否会首先发送前一个 PHP 标头(在它到达我的 header() 之前,它是否可以被任何嗅探器程序检测到?或者标头是否被 PHP '收集',之前 正在发送回浏览器?

                When I view the headers, I can see that it is now 'Alex' instead of the PHP version. My question is, will this send the previous PHP header first (before it reaches my header(), and is it detectable by any sniffer program? Or are headers 'collected' by PHP, before being sent back to the browser?

                顺便说一句,这不是为了安全起见,只是好奇标头在 PHP 中是如何工作的.

                By the way, this is not for security by obscurity, just curious how headers work in PHP.

                推荐答案

                在 PHP 中,直到 PHP 遇到第一个输出语句时才会发送标头.

                In PHP, headers aren't sent until PHP encounters its first output statement.

                这包括第一个 <?php 之前的任何内容.

                This includes anything before the first <?php.

                这也是为什么 setcookie 如果您在输出某些内容后尝试使用它会引发警告:

                This is also why setcookie sends throws a warning if you try to use it after something has been output:

                警告:无法修改标题信息 - 已发送的标头(输出开始于/path/to/php/file.php:100) 在/path/to/php/file.php 在第 150 行

                Warning: Cannot modify header information - headers already sent by (output started at /path/to/php/file.php:100) in /path/to/php/file.php on line 150

                请注意,如果 输出缓冲 正在使用,则这些都不适用,因为在运行适当的输出缓冲命令.

                Note that none of this applies if output buffering is in use, as the output will not be sent until the appropriate output buffering command is run.

                这篇关于隐藏 PHP 的 X-Powered-By 标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                  <tbody id='pRAOS'></tbody>

                <small id='pRAOS'></small><noframes id='pRAOS'>

                  1. <legend id='pRAOS'><style id='pRAOS'><dir id='pRAOS'><q id='pRAOS'></q></dir></style></legend>
                      <bdo id='pRAOS'></bdo><ul id='pRAOS'></ul>
                      1. <i id='pRAOS'><tr id='pRAOS'><dt id='pRAOS'><q id='pRAOS'><span id='pRAOS'><b id='pRAOS'><form id='pRAOS'><ins id='pRAOS'></ins><ul id='pRAOS'></ul><sub id='pRAOS'></sub></form><legend id='pRAOS'></legend><bdo id='pRAOS'><pre id='pRAOS'><center id='pRAOS'></center></pre></bdo></b><th id='pRAOS'></th></span></q></dt></tr></i><div id='pRAOS'><tfoot id='pRAOS'></tfoot><dl id='pRAOS'><fieldset id='pRAOS'></fieldset></dl></div>
                        <tfoot id='pRAOS'></tfoot>