Cover image for PHP 5 for dummies
PHP 5 for dummies
Valade, Janet.
Personal Author:
Publication Information:
New York : John Wiley, [2004]

Physical Description:
xiv, 392 pages : illustrations ; 23 cm
Format :


Call Number
Material Type
Home Location
Item Holds
QA76.73.P224 V34 2004 Adult Non-Fiction Computer Books
QA76.73.P224 V34 2004 Adult Non-Fiction Open Shelf

On Order



Covers the latest major release of PHP, the most popular open source Web scripting language, in the friendly, easy-to-understand For Dummies style PHP is installed on nearly nine million servers, and usage has grown at the rate of 6.5 percent per month for the past two years PHP is easy to learn, well suited for Web development, and can be embedded with HTML, making it a good choice for creating dynamic Web pages for e-commerce sites and other Web applications; a database-friendly language, it connects easily to Sybase, MySQL, mSQL, Oracle, and other databases Explains how to acquire and install PHP, how PHP's features make it a useful scripting language, and how to use PHP for three of the most common applications: interactive Web sites, database storage, and common operating system tasks

Author Notes

Janet Valade is a Web designer, programmer, and systems analyst with more than 20 years of computer experience

Table of Contents

Introductionp. 1
About This Bookp. 1
How to Use This Bookp. 2
Foolish Assumptionsp. 3
How This Book Is Organizedp. 4
Icons Used in This Bookp. 5
Part I Say Hello to the PHP Scripting Languagep. 7
Chapter 1 Getting to Know PHPp. 9
Getting Familiar with PHPp. 9
Considering the Various Uses for PHPp. 10
Understanding How PHP Worksp. 14
Keeping Up with Changes in PHPp. 16
Chapter 2 Setting Up the Environmentp. 19
Establishing Your Web Environmentp. 19
Setting Up PHP for General-Purpose Scriptingp. 30
Configuring PHPp. 32
Using Tools to Build PHP Scriptsp. 32
Chapter 3 Creating Your First PHP Scriptp. 35
Writing PHP Statementsp. 36
Building Scriptsp. 37
Writing Your First Scriptp. 42
Discovering More about Output Statementsp. 44
Documenting the Scriptp. 48
Part II Variables and Datap. 51
Chapter 4 Using Variables in PHP Scriptsp. 53
Naming Variablesp. 53
Assigning and Displaying Variable Valuesp. 55
Writing Your First Script That Uses Variablesp. 57
Discovering More about Output Statements with Variablesp. 59
Using Variable Variablesp. 60
Removing Variablesp. 61
Working with Constantsp. 62
Handling Error Messagesp. 67
Chapter 5 Working with Datap. 73
Understanding Data Typesp. 73
Working with Numbersp. 75
Working with Character Stringsp. 81
Working with Dates and Timesp. 92
Chapter 6 Storing Data in Groups by Using Arraysp. 97
Creating and Working with Arraysp. 97
Sorting Arraysp. 103
Using Arrays in Statementsp. 105
Walking through an Arrayp. 107
Finding Array Sizep. 110
Converting Arrays into Strings (And Vice Versa)p. 110
Converting Variables into Arrays (And Vice Versa)p. 112
Splitting and Merging Arraysp. 113
Comparing Arraysp. 115
Working with Other Array Operationsp. 116
Multidimensional Arraysp. 118
Built-in PHP Arraysp. 123
Part III Basic PHP Programmingp. 127
Chapter 7 Controlling the Flow of the Scriptp. 129
Changing the Order of Statement Executionp. 129
Setting Up Conditionsp. 131
Using Conditional Statementsp. 140
Repeating Actions by Using Loopsp. 145
Chapter 8 Reusing PHP Codep. 157
Inserting Code in Your Scriptp. 158
Creating Reusable Code (Functions)p. 162
Handling Errorsp. 174
Chapter 9 Object-Oriented Programming Meets PHPp. 177
Introducing Object-Oriented Programmingp. 177
Developing an Object-Oriented Programp. 181
Defining a Classp. 183
Using a Classp. 190
Making Properties and Methods Privatep. 191
Using Exceptionsp. 194
Copying Objectsp. 195
Destroying Objectsp. 196
Part IV Common PHP Applicationsp. 197
Chapter 10 The Basics of Web Applicationsp. 199
Securing Your Web Sitep. 200
Displaying Static Web Pagesp. 203
Working with HTML Formsp. 203
Chapter 11 Other Web Applicationsp. 223
Overcoming Statelessnessp. 223
Navigating Web Sites with Multiple Pagesp. 224
Moving Information from Page to Pagep. 226
Uploading Filesp. 238
Using JavaScript with PHPp. 244
Chapter 12 Storing Data with PHPp. 247
Using Flat Filesp. 249
Working with Databasesp. 259
Using SQLitep. 276
Chapter 13 PHP and Your Operating Systemp. 279
Managing Filesp. 279
Using Operating System Commandsp. 286
Using FTPp. 292
Using E-Mailp. 297
Chapter 14 PHP Extensionsp. 303
Investigating the Basic Extensionsp. 303
Taking a Look at Standard Extensionsp. 305
Using PEARp. 309
Part V The Part of Tensp. 319
Chapter 15 Ten Things to Look For When Troubleshooting a Scriptp. 321
Missing Semicolonsp. 321
Not Enough Equal Signsp. 322
Misspelled Variable Namesp. 322
Missing Dollar Signsp. 323
Troubling Quotesp. 323
Invisible Outputp. 324
Numbered Arraysp. 324
Including PHP Statementsp. 325
Missing Matesp. 325
Confusing Parentheses and Bracketsp. 326
Chapter 16 Ten PHP Resources You Can't Live Withoutp. 327
The PHP Web Sitep. 327
PHP Listsp. 327
Zendp. 328
PHP Builderp. 328
Black Beansp. 328
PHP Beginnersp. 328
PHP Dev Centerp. 329
PHPMac.comp. 329
PHP Editorsp. 329
SourceForge.netp. 329
Free PHP Hosting Directoryp. 330
My Web Sitep. 330
Part VI Appendixesp. 331
Appendix A Installing PHPp. 333
Installing PHP on Computers Running Unix/Linuxp. 333
Before installing on Unix/Linuxp. 334
Installing on Unix/Linuxp. 335
Alternative method for installing with Apachep. 336
Installing PHP on Computers Running Mac OS Xp. 339
Installation Options for Unix/Linux/Macp. 342
Configuring on Unix/Linux/Macp. 343
Installing PHP on Computers Running Windowsp. 345
Appendix B Useful PHP Built-in Functionsp. 353
Array Functionsp. 353
Date and Time Functionsp. 358
File System Functionsp. 359
HTTP and Mail Functionsp. 366
Mathematical Functionsp. 367
PHP Options and Information Functionsp. 369
String Functionsp. 370
Variable Functionsp. 375
Indexp. 377