Hiding PHP's X-Powered-By header

前端 未结 6 1979
太阳男子
太阳男子 2020-12-13 23:59

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

I also know by appending some checksums, you can get access to PHP\'s credits,

6条回答
  •  太阳男子
    2020-12-14 00:42

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

    This includes anything before the first .

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

    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.

提交回复
热议问题