Alarm system: PHP output header information to facilitate script crawling information

Source: Internet
Author: User

As a monitoring system, you need to monitor a certain page, you can make a number of ways to alarm, such as: normal output a specified variable, the error is not output. But there is a much more convenient way to use headers to throw information directly in the current error, such as:


However, just throw such a message, the solution to the problem is a little help and no, of course, the more information you want to capture the better, you can view the page according to certain rules, and the page output the specific error message. There may be more than one error, if each encounter an error to throw a header information, then PHP will produce a lot of warning, which is not compliant, workaround, use buffer to receive information, the final unified output can:

Ob_start ();        Open buffer #coding here#...ob_end_flush ();                         Output all content to browser

In this way, you can capture all of the information, and you won't have to use the header's warning multiple times!

Alarm system: PHP output header information to facilitate script crawling information

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.