Unlike those other professional-level books on open-source
scripting,
PHP for the World Wide Web: Visual QuickStart
Guide isn't just for professional programmers--it's
written for the rest of us with a passing familiarity with
HTML.
This visual, task-based guide gets users up and running
with the basics of PHP, starting with basic syntax, testing
scripts, working with variables, creating Web applications,
and more. Throughout the book, sample scripts and projects
show the reader just what they need to know, and a
companion Web site offers every script available for
downloading.
Contents
Introduction.
What Is PHP? Why Use PHP?
How PHP Works. What You'll Need. About This Book. PHP: VQS
Companion Website.
1. Getting Started With PHP. Basic Syntax. Sending Data
to the Browser. Testing Your Script. Adding Comments to
Your Scripts. Formatting Data Sent to the Browser. Escaping
Data Sent to the Browser.
2. Variables. What Are Variables?
Variable Syntax. Types of Variables. Numbers. Strings.
Assigning Values to Variables.
3. Receiving Data in the Script. Creating Forms in HTML.
Using Get or Post Methods. Getting Data from a Form.
Creating a Link to a Script. Getting Data from a Link.
Getting Data from Environment Variables. Inputting Data
Manually.
4. Using Numbers. Integers. Floating-Point
Numbers. Adding, Subtracting, Multiplying, and Dividing.
Modulus. Incrementing and Decrementing a Number. Using
Multiple Operators.
5. Using Strings. Trimming Strings. Finding
the Length of a String. Pulling out Sub-Strings.
Concatenating Strings. Encoding and Decoding Strings.
Escaping Strings.
6. Using Arrays. What Is an Array? Creating
an Array. Adding Elements to an Array. Deleting Elements
from an Array. Finding the Length of an Array. Retrieving a
Specific Element from an Array. Sorting Arrays. Creating a
String from an Array. Creating an Array from a String.
Passing an Array in a URL.
7. Operators. Arithmetic. Logical.
Bitwise. Assignment. Miscellaneous. Comparison.
Precedence.
8. Conditional Statements and Loops. The If Conditional. Using
Else. Using Else-If. The Switch Conditional. The While
Loop. The for Loop. Using Break and Exit. Evaluating
Multiple Conditions. Using Nested Conditional Statements
and Nested Loops.
9. Regular Expressions. What Are Regular
Expressions? Defining a Regular Expression. Matching. Ereg
versus Eregi. Matching and Replacing. Common Uses for
Regular Expressions.
10. Creating Functions. Creating Simple Functions.
Using Simple Functions. Creating Functions That Take Input.
Calling Functions That Take Input. Creating Functions That
Returns a Value. Using Functions That Returns a Value.
Variable Scope and the Global Statement.
11. Cookies. What Are Cookies? Current
Issues Regarding Cookies. Creating a Cookie. Determining a
Cookie's Expiration Date. Limiting a Cookie's Scope.
Getting Data from a Cookie. Deleting a Cookie. Alternatives
to Using Cookies.
12. Files and Directories. Opening Files. Reading
from Files. Writing to Files. Closing Files. Renaming
Files. Deleting Files. Handling File Uploads. Creating
Directories. Opening Directories. Closing Directories.
Changing the Directory.
13. Creating Web Applications. PHP and HTML. Using
Include and Require. Creating Templates. Using Hidden
Fields. Determining the Date and Time. Using HTTP Headers.
Sending Email.
14. Databases. Common Uses for Databases.
PHP Support for Databases. Sending Data to a Database.
Getting Data from a Database. Database Resources.
15. Debugging. Common Errors. Error
Reporting. Error Handling. Using Comments and Print
Statements to Find Errors. Following a Variable's Progress.
Using the Die Statement. Database Errors.
Appendix A: Installation and Configuration. Platform. Web Servers.
Modules. Security. Configuring. Other Resources.
Appendix B: Security. Why Security Is Important.
Cryptography. Using SSL. Writing Secure PHP.
Appendix C: PHP Resources. Suggested PHP Capabilities
to Learn. Websites. Newsgroups. PHP Script Resource
Libraries. Books.
Index.