PHP Common Errors

Source: Internet
Author: User

We are usingCommon PHP errors:

No page rendered by the Web browser when much more is expected

A pop-up dialog stating that the "Document Contains No Data"

A partial page when more is expected

Most common PHP errors are caused not by script logic, but by bugs in HTML or HTML generated by scripts. For example, the page cannot be refreshed without a close Tag such as </table>, </form>, and </frame>. To solve this problem, check the source code of HTML.

For pages that are complex and cannot find the cause, you can use the W3C page verification program http://validator.w3.org/for analysis.

If no variable is defined, or the definition of the variable is incorrect, the program will become odd. For example, the following endless loop:

 
 
  1. <?php   
  2. for($counter=0; $counter<10; $Counter++)   
  3. myFunction();   
  4. ?>   

The variable $ Counter is increasing, while the variable $ counter is always less than 10. Common Errors of this type of PHP can be found by setting a high error report level:

 
 
  1. <?php   
  2. error_reporting(E_ALL);   
  3.  
  4. for($counter=0; $counter<10; $Counter++)   
  5. myFunction();   
  6. ?>   

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.