PHP 5 for Dummies Free Open Book

PHP 5 for Dummies

Previous PageNext Page
Chapter 15
Ten Things to Look For When
Troubleshooting a Script
In This Chapter
Recognizing common PHP errors
Interpreting error messages
I
guarantee that you will do all the things that I mention in this chapter. You
just can’t write scripts without making these mistakes. The trick is to train
yourself to recognize them, roll your eyes, say, “Not again,” and just fix them.
One error message that you’ll see many times is
Parse error:parse error in c:\test.phpon line 7
This is PHP’s way of saying “Huh?” It means that it doesn’t understand some-
thing. This message helpfully points to the file and the line number where PHP
got confused. Sometimes it’s directly pointing at the error, but sometimes
PHP’s confusion results from an error earlier in the script.
Here are ten of the most common errors and how to avoid them.
Missing Semicolons
Every PHP statement ends with a semicolon (
;
). PHP doesn’t stop reading a
statement until it reaches a semicolon. If you leave out the semicolon at the
end of a line, PHP continues reading the statement on the following line. For
example, consider the following statement:
$test = 1
echo $test;
Previous PageNext Page


     Main Menu
PHP 5 for Dummies
Table of Contents
Introduction
Part I: Say Hello to the PHP Scripting Language
Part II: Variables and Data
Part III: Basic PHP Programming
Part IV: Common PHP Applications
Part V: The Part of Tens
Using a PEAR package - Page 336
Using a PEAR package - Page 337
Chapter 15: Ten Things to Look For When Troubleshooting a Script
Missing Semicolons
Not Enough Equal Signs
Misspelled Variable Names
Missing Dollar Signs
Troubling Quotes
Invisible Output
Numbered Arrays
Including PHP Statements
Missing Mates
Confusing Parentheses and Brackets
Chapter 16: Ten PHP Resources You Can't Live Without
Part VI: Appendixes
Index
Team DDU


More Books
PHP Hacks
Processing Xml With Java - A Guide To Sax, Dom, Jdom, Jaxp, And Trax
The Koran (Holy Qur'an)
Macromedia Flash 8 Bible
Search Engine Optimization for Dummies
YouTube Traffic
PHP 5 for Dummies
Harry Potter and The Chamber of Secrets
Harry Potter and the Sorcerer's Stone
The Pilgrim's Progress
Wireless Hacks
Flash Hacks. 100 Industrial-Strength Tips & Tools
PayPal Hacks. 100 Industrial-Strength Tips and Tools
Amazon Hacks
Pdf Hacks
The Da Vinci Code
Google Hacks
The Holy Bible
Windows XP For Dummies
Harry Potter and the Half-Blood Prince
Seo Book
Upgrading and Repairing Networks
Macromedia Dreamweaver 8 UNLEASHED
Windows XP Annoyances
Windows XP Hacks
Microsoft Windows XP Power Toolkit
Teach Yourself MS Office In 24Hours
iPod & iTunes Missing Manual
PC Hacks 100 Industrial-Strength Tips and Tools
PC Overclocking, Optimization, and Tuning - 2th Edition
PC Hardware In A Nutshell 3rd Edition
PC Hardware in a Nutshell, 2nd Edition
Upgrading and Repairing PCs
Google for Dummies
MySQL Cookbook
Teach Yourself Macromedia Flash 8 In 24 Hours
PHP CookBook
Sams Teach Yourself JavaScript in 24 Hours
PHP5 Manual
Free Games Paper Airplanes
500 Juegos Gratis 500 Giochi Gratis 500 Jeux Gratuits 500 Jogos Gratis 500 Kostenlose Spiele