Get the App
SLTechnology News&Howtos  ›  Development  › 

How to make use of the invalid solution of header jump by php

Shulou Source: shulou.com Published: 2022-06-03 04:10:18 11月05日 Update

This article mainly explains "php how to use header jump invalid solution", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's train of thought slowly in depth, together to study and learn "php how to use header jump invalid solution" bar!

Php takes advantage of the invalid solution of header jump: 1, find and open the php.ini configuration file; 2, change output_buffering = Off to output_buffering = 4096; restart the server.

This article operating environment: windows10 system, php 7, thinkpad T480 computer.

Solution:

1. Modify php.ini

2. Find output_buffering=Off and change it to output_buffering=4096

3. Restart the server.

Using header ("location:test.php") to jump in PHP should pay attention to the following points:

1. There can be no space between location and ":", otherwise there will be an error. / / phpfensi.com

2. There can be no output before using header, including no spaces after the tag "? >" in the include page.

3. The PHP code after header will also be executed.

There cannot be any content output before PHP's header jump, because the PHP sends HTTP headers to the browser when it starts execution, and then changes are no longer allowed.

But if you have to process the header information after the output, you can use ob_start () ob_end_flush () to cache the content to be sent, and wait until header continues to send the content.

Thank you for your reading, the above is the content of "php how to use header jump invalid solutions". After the study of this article, I believe you have a deeper understanding of how php uses header jump invalid solutions, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Methods content learning output information servers services use code that is ideas situations files articles times more browsers environments computers knowledge Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Shulou Tech Info Shulou Technology Microsoft MariaDB