1 / 10

Chapter 8

Chapter 8. Error Handling and Debugging. Debugging. “ When you get frustrated, step away from the computer!”. Error Sources. HTML PHP Syntax Run-time Logical SQL MySQL. Debugging HTML. Layout is messed up. http://validator.w3.org /. Debugging PHP. Syntax errors & Run-time errors

rene
Download Presentation

Chapter 8

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 8 Error Handling and Debugging

  2. Debugging • “When you get frustrated, step away from the computer!”

  3. Error Sources • HTML • PHP • Syntax • Run-time • Logical • SQL • MySQL

  4. Debugging HTML • Layout is messed up. • http://validator.w3.org/

  5. Debugging PHP • Syntax errors & Run-time errors • Error messages • Logical errors • Hardest • echo variables

  6. display_errors.php • Script 8.1 on page 248 • http://cscdb.nku.edu/csc301/frank/ch08/display_errors.php • See 3 on page 249 for explain of errors • ch08\display_errors.php • Turn off • ini_set(‘display_errors’, 0);

  7. report_errors.php • Script 8.2 on page 251 • http://cscdb.nku.edu/csc301/frank/ch08/report_errors.php • ch08\report_errors.php

  8. Error Report Levels • Table 8-1 on page 250 • E_ALL – all errors, warnings, and recommendations • E_ERROR – all fatal run-time errors • E_DEPRECATED – warnings about code that will not work in the future

  9. Rule of Thumb • “you’ll want PHP to report on any kind of error while you’re developing a site but report no specific errors once the site goes live.”

  10. handle_errors.php • Script 8.3 on page 254 • http://cscdb.nku.edu/csc301/frank/ch08/handle_errors.php • ch08\handle_errors.php

More Related