×

Uh-oh, it looks like your Internet Explorer is out of date.

For a better shopping experience, please upgrade now.

Learning PHP 5 / Edition 1
     

Learning PHP 5 / Edition 1

3.0 1
by David Sklar
 

See All Formats & Editions

ISBN-10: 0596005601

ISBN-13: 2900596005602

Pub. Date: 07/02/2004

Publisher: O'Reilly Media, Incorporated

PHP has gained a following among nontechnical web designers who need to add interactive aspects to their sites. Offering a gentle learning curve, PHP is an accessible yet powerful language for creating dynamic web pages. As its popularity has grown, PHP's basic feature set has become increasingly more sophisticated. Now PHP 5 boasts advanced features -- such as new

Overview

PHP has gained a following among nontechnical web designers who need to add interactive aspects to their sites. Offering a gentle learning curve, PHP is an accessible yet powerful language for creating dynamic web pages. As its popularity has grown, PHP's basic feature set has become increasingly more sophisticated. Now PHP 5 boasts advanced features -- such as new object-oriented capabilities and support for XML and Web Services -- that will please even the most experienced web professionals, while still remaining user-friendly enough for those with a lower tolerance for technical jargon. If you want to try your hand at PHP but don't know where to start, then Learning PHP 5 is the book you need. With attention to both PHP 4 and the new PHP Version 5, it provides everything from a explanation of how PHP works with your web server and web browser to the ins and outs of working with MySQL databases and HTML forms. Written by the coauthor of the popular PHP Cookbook, this book is for intelligent (but not necessarily highly technical) readers.

Product Details

ISBN-13:
2900596005602
Publisher:
O'Reilly Media, Incorporated
Publication date:
07/02/2004
Edition description:
First Edition
Pages:
370

Table of Contents

Prefacexi
1.Orientation and First Steps1
PHP's Place in the Web World1
What's So Great About PHP?4
PHP in Action6
Basic Rules of PHP Programs11
Chapter Summary15
2.Working with Text and Numbers16
Text16
Numbers25
Variables27
Chapter Summary31
Exercises32
3.Making Decisions and Repeating Yourself33
Understanding true and false34
Making Decisions35
Building Complicated Decisions37
Repeating Yourself43
Chapter Summary46
Exercises46
4.Working with Arrays48
Array Basics48
Looping Through Arrays52
Modifying Arrays57
Sorting Arrays60
Using Multidimensional Arrays63
Chapter Summary66
Exercises67
5.Functions69
Declaring and Calling Functions70
Passing Arguments to Functions71
Returning Values from Functions74
Understanding Variable Scope78
Chapter Summary82
Exercises82
6.Making Web Forms84
Accessing Form Parameters88
Form Processing with Functions90
Validating Data93
Displaying Default Values103
Putting It All Together105
Chapter Summary112
Exercises112
7.Storing Information with Databases114
Organizing Data in a Database115
Connecting to a Database Program117
Creating a Table119
Putting Data into the Database121
Inserting Form Data Safely126
Generating Unique IDs127
A Complete Data Insertion Form128
Retrieving Data from the Database131
Changing the Format of Retrieved Rows136
Retrieving Form Data Safely138
A Complete Data Retrieval Form141
MySQL Without PEAR DB145
Chapter Summary148
Exercises149
8.Remembering Users with Cookies and Sessions151
Working with Cookies152
Activating Sessions156
Storing and Retrieving Information157
Configuring Sessions160
Login and User Identification161
Why setcookie() and session_start() Want to Be at the Top of the Page167
Chapter Summary168
Exercises169
9.Handling Dates and Times170
Displaying the Date or Time170
Parsing a Date or Time175
Dates and Times in Forms176
Displaying a Calendar186
Chapter Summary190
Exercises190
10.Working with Files192
Understanding File Permissions192
Reading and Writing Entire Files193
Reading and Writing Parts of Files197
Working with CSV Files200
Inspecting File Permissions203
Checking for Errors204
Sanitizing Externally Supplied Filenames206
Chapter Summary208
Exercises208
11.Parsing and Generating XML210
Parsing an XML Document211
Generating an XML Document217
Chapter Summary219
Exercises219
12.Debugging221
Controlling Where Errors Appear221
Fixing Parse Errors222
Inspecting Program Data226
Fixing Database Errors229
Chapter Summary230
Exercises230
13.What Else Can You Do with PHP?232
Graphics232
PDF233
Shockwave/Flash234
Browser-Specific Code236
Sending and Receiving Mail236
Uploading Files in Forms237
The HTML_QuickForm Form-Handling Framework239
Classes and Objects242
Advanced XML Processing244
SQLite247
Running Shell Commands248
Advanced Math249
Encryption250
Talking to Other Languages251
IMAP, POP3, and NNTP251
Command-Line PHP253
PHP-GTK253
Even More Things You Can Do with PHP254
A.Installing and Configuring the PHP Interpreter255
B.Regular Expression Basics280
C.Answers To Exercises296
Index335

Customer Reviews

Average Review:

Post to your social network

     

Most Helpful Customer Reviews

See all customer reviews

Learning PHP 5 3 out of 5 based on 0 ratings. 1 reviews.
Guest More than 1 year ago
This book covers the absolute basics of PHP. For anyone making the transition to PHP from PERL, this book will probably be too basic. Covering topics like variables, arrays, and very basic web implementation, anyone who isn't a programmer could use this book to help connect a web front end with a database (such as MySQL). I really recommend buying Programming PHP along with this book if you're looking for intermediate topics.