Introduction |
|
xix | |
|
|
1 | (30) |
|
|
1 | (1) |
|
Installing, Configuring, and Running PHP |
|
|
2 | (4) |
|
|
3 | (1) |
|
php.ini, the PHP Configuration File |
|
|
3 | (1) |
|
Setting Up a Test Machine |
|
|
4 | (1) |
|
|
4 | (1) |
|
|
4 | (1) |
|
|
5 | (1) |
|
Installing PHP5 with Linux and Apache |
|
|
6 | (13) |
|
Choosing Your Installation Method |
|
|
6 | (10) |
|
Setting up Apache for PHP |
|
|
16 | (3) |
|
Installing PHP5 on Windows 2000/Internet Information Server (IIS) 5 |
|
|
19 | (7) |
|
|
20 | (2) |
|
|
22 | (4) |
|
Testing and Troubleshooting |
|
|
26 | (2) |
|
|
28 | (1) |
|
|
28 | (1) |
|
|
29 | (1) |
|
|
29 | (1) |
|
|
29 | (1) |
|
|
30 | (1) |
|
|
31 | (32) |
|
Create a Simple PHP Program |
|
|
31 | (5) |
|
|
33 | (1) |
|
|
33 | (3) |
|
How Online PHP Programs Run |
|
|
36 | (1) |
|
Web Communications: Internet Protocols and HTTP |
|
|
36 | (5) |
|
|
37 | (1) |
|
|
37 | (4) |
|
|
41 | (5) |
|
Issues Concerning Creating Variables |
|
|
41 | (4) |
|
|
45 | (1) |
|
Operators and Expressions |
|
|
46 | (16) |
|
|
46 | (1) |
|
|
47 | (1) |
|
|
47 | (11) |
|
|
58 | (4) |
|
|
62 | (1) |
|
|
62 | (1) |
|
|
63 | (60) |
|
|
63 | (4) |
|
The HTML Document Type Definition |
|
|
65 | (1) |
|
The Form and Input Elements |
|
|
65 | (2) |
|
Accessing PHP and HTTP Data |
|
|
67 | (5) |
|
|
67 | (2) |
|
Variables in HTTP Request and Response |
|
|
69 | (1) |
|
|
69 | (3) |
|
|
72 | (1) |
|
|
73 | (1) |
|
|
74 | (34) |
|
|
74 | (5) |
|
HTML Form Fields (Controls) and PHP |
|
|
79 | (29) |
|
|
108 | (12) |
|
|
108 | (8) |
|
|
116 | (4) |
|
|
120 | (1) |
|
|
120 | (3) |
|
Decisions, Loops, and Arrays |
|
|
123 | (64) |
|
Designing PHP Program Logic |
|
|
123 | (4) |
|
|
123 | (1) |
|
|
124 | (1) |
|
|
125 | (2) |
|
Conditional or Branching Statements |
|
|
127 | (18) |
|
|
128 | (1) |
|
|
129 | (11) |
|
|
140 | (5) |
|
|
145 | (40) |
|
|
145 | (16) |
|
|
161 | (24) |
|
|
185 | (1) |
|
|
185 | (2) |
|
|
187 | (44) |
|
|
187 | (2) |
|
Values That Break Your Code |
|
|
188 | (1) |
|
|
189 | (1) |
|
|
189 | (9) |
|
Understanding PHP Error Messages |
|
|
189 | (1) |
|
|
190 | (3) |
|
|
193 | (1) |
|
|
193 | (5) |
|
Debugging and Handling Errors in PHP5 |
|
|
198 | (1) |
|
Preventing the Display of Private Information |
|
|
198 | (1) |
|
Roll-Your-Own Debugging Tools |
|
|
198 | (1) |
|
|
199 | (21) |
|
|
200 | (4) |
|
String Validation and Regular Expressions |
|
|
204 | (9) |
|
|
213 | (5) |
|
Using Regexps to Check File Path Parameters |
|
|
218 | (2) |
|
Handling Errors Gracefully |
|
|
220 | (9) |
|
Configuring PHP for Error Handling |
|
|
220 | (2) |
|
|
222 | (7) |
|
|
229 | (1) |
|
|
230 | (1) |
|
Writing High-Quality Code |
|
|
231 | (28) |
|
|
231 | (3) |
|
Formal Software Development Processes |
|
|
232 | (2) |
|
|
234 | (1) |
|
|
234 | (2) |
|
Writing User-Defined Functions in PHP |
|
|
236 | (11) |
|
The Structure of Functions |
|
|
237 | (6) |
|
|
243 | (2) |
|
How Values Get Inside Functions |
|
|
245 | (2) |
|
|
247 | (7) |
|
Global and Local Variables |
|
|
247 | (1) |
|
Creating Static Function Variables |
|
|
248 | (3) |
|
|
251 | (1) |
|
|
251 | (3) |
|
The Include and Require Statements |
|
|
254 | (3) |
|
Things To Be Careful About with Include and Require |
|
|
257 | (1) |
|
|
257 | (1) |
|
|
258 | (1) |
|
|
259 | (54) |
|
File and Directory Handling |
|
|
260 | (1) |
|
|
260 | (9) |
|
Opening and Closing Files |
|
|
261 | (3) |
|
Getting Information About a File |
|
|
264 | (1) |
|
Reading and Writing to Files |
|
|
264 | (5) |
|
Reading and Writing Characters in Files |
|
|
269 | (3) |
|
|
272 | (2) |
|
Random Access to File Data |
|
|
274 | (4) |
|
Getting Information on Files |
|
|
278 | (4) |
|
Ownership and Permissions |
|
|
282 | (5) |
|
Working with Files You Own |
|
|
287 | (3) |
|
Splitting the Name and Path from a File |
|
|
287 | (1) |
|
Copying, Renaming, and Deleting Files |
|
|
288 | (2) |
|
|
290 | (10) |
|
Other Directory Functions |
|
|
292 | (2) |
|
Traversing a Directory Hierarchy |
|
|
294 | (1) |
|
Creating a Directory Navigator |
|
|
295 | (5) |
|
|
300 | (7) |
|
|
307 | (5) |
|
|
312 | (1) |
|
|
312 | (1) |
|
|
313 | (30) |
|
|
313 | (2) |
|
|
315 | (7) |
|
Major Parts of an XML Document |
|
|
315 | (1) |
|
Well-Formed XML Documents |
|
|
316 | (1) |
|
Using XML Elements and Attributes |
|
|
317 | (1) |
|
Valid XML Documents: DTDs and XML Schemas |
|
|
318 | (4) |
|
|
322 | (1) |
|
|
322 | (1) |
|
|
323 | (11) |
|
|
329 | (3) |
|
The Document Object Model |
|
|
332 | (2) |
|
|
334 | (6) |
|
|
334 | (4) |
|
Changing a Value with simpleXML |
|
|
338 | (2) |
|
|
340 | (1) |
|
|
341 | (2) |
|
An Introduction to Databases and SQL |
|
|
343 | (48) |
|
|
344 | (3) |
|
|
344 | (1) |
|
|
345 | (1) |
|
|
346 | (1) |
|
|
347 | (4) |
|
|
347 | (1) |
|
|
348 | (2) |
|
|
350 | (1) |
|
|
351 | (9) |
|
|
352 | (3) |
|
Talking to Databases with SQL |
|
|
355 | (5) |
|
|
360 | (7) |
|
Starting the mysql Client Program |
|
|
360 | (1) |
|
Selecting a Database to Use |
|
|
361 | (1) |
|
Looking at Tables Inside a Database |
|
|
362 | (1) |
|
Using SQL to Look at Data |
|
|
363 | (1) |
|
Manipulating Data in a Database |
|
|
364 | (1) |
|
Using GRANT and REVOKE Commands |
|
|
365 | (2) |
|
Connecting to MySQL from PHP |
|
|
367 | (1) |
|
|
368 | (7) |
|
Basic Connection Functions |
|
|
368 | (3) |
|
|
371 | (4) |
|
Creating Databases and Tables from MySQL |
|
|
375 | (13) |
|
Creating the Sample Database and Tables with PHP |
|
|
379 | (4) |
|
|
383 | (2) |
|
Inserting Data into a Table |
|
|
385 | (3) |
|
|
388 | (3) |
|
Retrieving Data from MySQL Using PHP |
|
|
391 | (26) |
|
Retrieving Data Using PHP |
|
|
391 | (3) |
|
SQL Statements for Retrieving Data |
|
|
394 | (10) |
|
|
394 | (1) |
|
|
395 | (5) |
|
|
400 | (1) |
|
|
401 | (3) |
|
|
404 | (11) |
|
The common_db.inc File Contents |
|
|
405 | (2) |
|
The userviewer.php File Contents |
|
|
407 | (7) |
|
|
414 | (1) |
|
|
415 | (2) |
|
Using PHP to Manipulate Data in MySQL |
|
|
417 | (44) |
|
Inserting Records Using PHP |
|
|
417 | (3) |
|
|
418 | (1) |
|
|
419 | (1) |
|
Updating and Deleting Records in Tables |
|
|
420 | (2) |
|
Working with Date and Time Type Fields |
|
|
422 | (4) |
|
Getting Information on Database Tables |
|
|
426 | (5) |
|
ENUM Options and Field Defaults |
|
|
431 | (4) |
|
Creating a User Registration Script |
|
|
435 | (7) |
|
|
435 | (5) |
|
|
440 | (2) |
|
Creating an Access Logger Script |
|
|
442 | (7) |
|
|
442 | (2) |
|
|
444 | (5) |
|
|
449 | (9) |
|
|
449 | (8) |
|
Choosing an Action to Take |
|
|
457 | (1) |
|
|
458 | (1) |
|
|
459 | (2) |
|
An Introduction to Object-Oriented Programming |
|
|
461 | (32) |
|
What Is Object-Oriented Programming? |
|
|
461 | (2) |
|
Understanding OOP Concepts |
|
|
463 | (27) |
|
|
463 | (1) |
|
|
464 | (13) |
|
|
477 | (9) |
|
|
486 | (3) |
|
|
489 | (1) |
|
|
490 | (1) |
|
|
491 | (1) |
|
|
491 | (2) |
|
Working with UML and Classes |
|
|
493 | (36) |
|
The Unified Modeling Language |
|
|
493 | (3) |
|
Why Would You Want to Use UML? |
|
|
494 | (1) |
|
|
494 | (1) |
|
|
495 | (1) |
|
Creating the Contact Manager |
|
|
496 | (7) |
|
The Contact Manager UML Diagrams |
|
|
496 | (4) |
|
Other Useful UML Diagrams |
|
|
500 | (3) |
|
Creating the Entity Class |
|
|
503 | (6) |
|
|
509 | (18) |
|
|
509 | (3) |
|
|
512 | (4) |
|
|
516 | (1) |
|
The Entity, Individual, and Organization Classes |
|
|
517 | (8) |
|
|
525 | (2) |
|
|
527 | (2) |
|
|
529 | (38) |
|
|
529 | (5) |
|
|
530 | (2) |
|
|
532 | (2) |
|
|
534 | (11) |
|
Finding Your Way Around pear.php.net |
|
|
534 | (1) |
|
Exploring PEAR Classes and Applications |
|
|
534 | (1) |
|
Installing and Using the PEAR Package Manager |
|
|
535 | (10) |
|
|
545 | (21) |
|
Building an Application Using Two PEAR Components |
|
|
551 | (15) |
|
|
566 | (1) |
|
|
567 | (18) |
|
|
567 | (1) |
|
|
568 | (1) |
|
Structure of an E-Mail Message |
|
|
568 | (2) |
|
|
570 | (5) |
|
Using the mail() Function |
|
|
570 | (2) |
|
Multipurpose Internet Mail Extensions |
|
|
572 | (2) |
|
|
574 | (1) |
|
Building a Simple PHP E-Mail Application |
|
|
575 | (8) |
|
|
583 | (1) |
|
|
583 | (2) |
|
|
585 | (28) |
|
Basics of Computer Graphics |
|
|
585 | (3) |
|
|
586 | (1) |
|
|
586 | (1) |
|
|
587 | (1) |
|
Working with Raster Images |
|
|
588 | (10) |
|
|
588 | (1) |
|
|
588 | (1) |
|
|
589 | (9) |
|
Manipulating Raster Images |
|
|
598 | (9) |
|
Opening an Existing Image |
|
|
598 | (2) |
|
|
600 | (4) |
|
|
604 | (3) |
|
|
607 | (5) |
|
|
607 | (2) |
|
|
609 | (3) |
|
|
612 | (1) |
|
|
612 | (1) |
|
Case Study: A PHP Logging Agent |
|
|
613 | (58) |
|
|
614 | (7) |
|
|
615 | (5) |
|
|
620 | (1) |
|
Designing the Logging Agent |
|
|
621 | (7) |
|
|
622 | (2) |
|
Using UML to Map Out the Logging Agent |
|
|
624 | (4) |
|
|
628 | (26) |
|
|
628 | (4) |
|
|
632 | (13) |
|
Validation and Error-Handling Scripts |
|
|
645 | (6) |
|
Presentation Scripts and Templates |
|
|
651 | (3) |
|
|
654 | (11) |
|
Working with the Logging Agent |
|
|
665 | (5) |
|
|
666 | (1) |
|
Viewing the Logging Agent |
|
|
666 | (4) |
|
|
670 | (1) |
Appendix A: Answers |
|
671 | (22) |
Appendix B: PHP Functions Reference |
|
693 | (72) |
Appendix C: Using SQLite |
|
765 | (16) |
Appendix D: ODBC |
|
781 | (14) |
Appendix E: PHP CLI |
|
795 | (10) |
Appendix F: Configuring PHP5 |
|
805 | (24) |
Index |
|
829 | |