Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 8 Error Handling and Debugging. Debugging “When you get frustrated, step away from the computer!”

Similar presentations


Presentation on theme: "Chapter 8 Error Handling and Debugging. Debugging “When you get frustrated, step away from the computer!”"— 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://csweb.hh.nku.edu/csc301/frank/ch08/ display_errors.php http://csweb.hh.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://csweb.hh.nku.edu/csc301/frank/ch08/r eport_errors.php http://csweb.hh.nku.edu/csc301/frank/ch08/r eport_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://csweb.hh.nku.edu/csc301/frank/ch08/ handle_errors.php http://csweb.hh.nku.edu/csc301/frank/ch08/ handle_errors.php ch08\handle_errors.php


Download ppt "Chapter 8 Error Handling and Debugging. Debugging “When you get frustrated, step away from the computer!”"

Similar presentations


Ads by Google