作者:empty 页数:1080 出版社:empty |
empty
Contents
About the Author.
About the Technical Reviewers.
Acknowledgments.
Introduction.
CHAPTER 1
CHAPTER 2
I CONTENTS
CHAPTER 3
Introducing PHP.
History.
PHP 4.
General Language Features
Configuring Your Environment
Installation Prerequisites.
Install ng Apache and PHP on Linux.
Instal ing Apache and PHP on Windows.
Installing I IS and PHP on Windows.
Testing Your Installation.
PHP 5.
PHP 6.
Practicality.
Power.
Possibility.
Price.
Summary.
Configuring PHP.
Run-Time Conf guration.
Choosing a Code Editor.
Chaos in ga Web H osng Provider.
Downloading Apache.
Downloading PHP.
Oban ing the Document at on.
Ins tail inglIS and PHP.
Default Syntax.
Short-Tags.
Script.
ASP Style.
Embedding Multiple Code Blocks.
Single-Line C++Syntax.
Shell Syntax.
Mult ple-Line C Syntax.
The print) Statement.
The printf) Statement.
The sprintf) Statement.
Scalar Datatypes.
Compound Datatypes.
Confi uring Fast CGl to Manage PHP Processes
Conf iurngPHPatBuidTieonLiux.
Customizing the Windows Build.
Managing PHP'sConfguratonDirecves.
PHP's Configuration Directives.
Adobe Dreamweaver CS 3.
Notepad++.
PDT(PHP Development Tools) .
Zend Studio.
Seven Quest ons for Any Prospect ve Hot g Provider.
Summary.
PHP Basics
Embedding PHP Code in Your WebPages.
Comment ng Your Code.
Outputing Data to the Browser.
PHP's Supported Datatypes.
Identifiers.
Variables.
Conve ring Between Da type sUing Type Ca sig. 69
Ada ping Datatypes with Type Juggling.70
Type-Related Functions.,71
Type l denti fier Functions.72
Variable Declaration.74
Variable Scope, .76
PHP's Super global Variables.80
Variable Variables.86
Constants.
Expressions.
String Interpolation.
Control St cures.
Operands.
Operators.
Double Quotes.
Single Quotes.
Here doc.
Conditional Statements.
Looping Statements.
File-Inclusion Statements.
Summary.
Functions.
Invoking a Funcion.
Creating a Funct on.
Function Libraries.
CHAPTER 4
CHAPTER 5
U CONTENTS
CHAPTER 6
Passing Arguments by Value.
Passing Arguments by Reference.
Default Argument Values.
Returning Values from a Function.
Recursive Functions.
Summary.
Arrays.
What Is an Array?.
Crea ingan Array.
Adding and Remov ngA ray Elements.
Locating Array Elements.
Traversing Arrays.
Determining ArraySize and Uniqueness.
Sorting Arrays.
Creating Arrays with array 0.
Extracting Arrays with list.
Populating Arrays wth a Predefined Value Range.
Testing for an Array.
Adding a Value to the Front of an Array.
Adding a Value on to the End of an Array.
Removing a Value from the Front of an Array . 135
Removing a Value from the End of an Array.136
Searching an Array.136
Retrieving Array Keys.137
Retrieving Array Values.138
Re trev ing the Current A ay Key.139
Retrieving the Current Array Value.139
Retrieving the Current Array Key and Value.140
Moving the Array Pointer.140
Passing Array Values to a Funct on.142
Determining the Sizeof an Array.
Count ng Array Value Frequency.
Determining Unique Array Values.
Reversing A ray Element Order.
Flipping Array Keys and Values.
Sort ngan Array.
Merging Arrays.
Recurs vely Appending Arrays.
Combining Two Arrays.
Slicing an Array.
Splicing an Array.
Calculat ngan Array Intersection.
Calculating Assoc lative Array Intersections.
Calculating Array Dit ferences.
Calculating Assoc lat ve Array Differences.
Returning a Random Set of Keys
S huffing Array Elements.
Encapsulation.
Inheritance.
Polymorphism.
Merging, Slc ing, Sp liing, and Ds sec ng Arrays.
Other Useful Array Functions.
Summary.
Object-Oriented PHP.
The Benefits of 00P.
Key OOP Concepts.
Constructors and Destructors
Static Class Members.
The instance of Keyword.
Helper Functions.
Autoloading Objects.
Classes.
0bjects.
Fields.
Properties.
Constants.
Methods.
Constructors.
Destructors.
Summary.
Advanced OOP Features.
CHAPTER 7
CHAPTER 8
U CONTENTS
CHAPTER 9
Advanced OOP Features Not Supported by PHP.
Object Cloning.
Inheritance.
Interfaces.
Abstract Classes.
Introducing Namespaces.
Cloning Example.
The__cone) Method.
Class Inheritance.
Inheritance and Constructors.
Implement nga Single Interface.
Implementing Mult ple Interfaces.
Summary.
Error and Exception Handling.
Configuration Direc ves.
Error Logging.
Excep ion Handing.
Summary.
Why Exception Hand i gIs Handy.
PHP's Exception-Handling Implementation.
Strings and Regular Expressions.
Regular Expressions.
0ther String-Specific Functions.
Alternat ves for RegularExpression Functions.
TakingAdvantageofPEAR:Validate_US.
RegularExpression Syntax(POSX) .
Parsing Directory Paths.
Cacu laing File, Directory, and Disk Sizes.
Determining Access and Modification Times.
The Concept of a Resource.
Recognizing Newline Characters.
Recognizing the End-of-File Character
Opening and Closing a File.
Reading from a File.
Wi tinga String to a File.
Moving the File Pointer.
Reading Directory Contents.
Sanitizing the Input.
PHP's Program Execut on Functions.
PHP's RegularExpression Funct ns(POSIX Extended) .
RegularExpression Syntax(Perl) .
Determining the Length of a String.
Comparing Two Strings.
Manipulating String Case.
Conve ting Strng s to and from HTML
Padding and Stripping a String.
Coun ing Characters and Words.
Installing Validate_US.
Using Validate_US.
Summary.
Leaming About Files and Directories.
Working with Files.
Execu ing Shell Commands.
System-Level Program Execution.
Summary.
M CHAPTER 10 Working with the File and OperatingSystem . 277
CHAPTER 11PEAR.
CHAPTER 12 DateandTime.
U CONTENTS
CHAPTER 13 Forms.
Popular PEAR Packages.
Preinstalled Packages.
Installer-Suggested Packages.
Installing PEAR.
PEAR and Host gCom panes.
Updating PEAR.
Viewing an Installed PEAR Package.
Valid a ing Dates.
Format ng Dates and Times.
Conver nga Timestamp to User-Friendly Values.
Working with Timestamps.
Ds payg the Loca zed DateandTime.
A Simple Example.
Passing Form Data to a Funct on.
Working with Mul valued Form Components.
Installing HTML_Quick Form.
Creating a Simple Form.
Using Auto-Completion.
Authentication Variables.
Useful Functions.
Hard-Coded Authentication.
File-based Authentication.
Database-based Authen t cation.
IP-based Authentic at on.
TakingAdvantageofPEAR:Auth_HTTP.
PHP's FileUpload/Resource Directives
The$_FILES Array.
PHP's File-Upload Functions.
Upload Error Messages.
A Simple Example.
The Power of PEAR:Conve ring Numeral Formats.
Installing and Updating PEAR.
Uing the PEAR Package Manager.
Lea mig More About an Inst led PEAR Package.
Installing aPEAR Package.
Including a Package Within Your Scripts.
Upgrading Packages.
Uninstalling a Package.
Downgrading a Package.
Summary.
The Unix Timestamp.
PHP's DateandTime Library.
Date Fu.
DateandTime Enhancements for PHP 5.1+Users.
Dia ying the WebPages Most Recent Mod finD ate. 338
Determining the Number of Days in the Current Month . 339
Determining the Number of Days in Any Given Month . 339
Calculating the Date X Days from the Present Date.340
Taking Advantage of PEAR:Creating a Calendar.341
Introducing the DateTime Constructor.345
Formatting Dates.346
Set ng the Date Aer Instant at n.346
Seting the Time After Instantiation.347
Modifying Dates and Times.347
Summary.348
PHP and WebForms.349
TakingAdvantageofPEAR:HTML_QuickForm.355
Summary.364
HTTP Authentication Concepts.366
PHP Authentication.367
PHP Authentication Methodologies.370
User Login Administration.
M CHAPTER 14 Authenticating Your Users.
CHAPTER 15 Handling File Uploads.
Testing Password Guess ablity with the CrackLib Library . 380
One-Time URLs and Password Recovery.383
Summary.386
Uploading Files via HTTP.387
Uploading Files wth PHP.388
TakingAdvantageofPEAR:HTTP_Upload.
Installing HTTP_Upload.
Uploading a File.
Services.
Establ i hing Socket Connections.
Configuration Directv es.
Sending E-mai Using a PHP Script.
Pinging a Server.
Creating a Port Scanner.
Creating a Subnet Converter.
Testing User Bandwidth.
Connec ng to an LDAP Server.
Retrieving LDAP Data.
Count gRe tie ved Entries.
Sorting LDAP Records.
Inserting LDAP Data.
Updating LDAP Data.
Deleting LDAP Data.
Working with the Distinguished Name.
Error Handing.
The Session-Handling Process.
Managing the Session Storage Media.
Set tng the Session Files Path.
Automatically Enabling Sessions.
Setting the Session Name.
Choosing Cookies or URL Rewriting.
Automating URL Re wrt ing.
Setting the Session Cookie Lifetime.
Seting the Session Cooke'sV aid URL Pah.
Variable Modi iers.
Control Structures.
Statements.
config load.
Referenc ng Configura tn Va ables
Learing More About an Uploaded ile.
Uploading Multiple Files.
Summary.
DNS, Services, and Servers.
DNS.
Mail.
Common Ne working Tasks.
Summary.
Using LDAP from PHP.
Summary.
What Is Session Hand ig?.
Configuration Directives.
Working with Sessions.
Practical Session-Handling Examples.
Creating Custom Session Handlers.
CHAPTER 16 Networking.
CHAPTER 17PHPandLDAP.
U CONTENTS
CHAPTER 18 Session Handlers.
M CHAPTER 19 Templating with Smarty.
Setting Caching Directions for Session-Enabled Pages.
Starting a Session.
Destroying a Session.
Set ng and Re treng the SessionID
Creating and Deleting Session Variables.
Encoding and Decoding Session Data.
Automaticaly Logging In Returning Users.
Generating a Recent iy Viewed Document Index.
Tying Custom Session Functions into PHP's Logic.
Using Custom MySQL-Based Session Handlers.
Summary.
Whats a Temp laing Engine?.
Introducing Smarty.
Instal ing Smarty.
Using Smarty.
Smarts Present atic nal Logic
Comments.
Creating Configuration Files.
Using CSS in Conjunction wih Smarty.
Caching.
Working wih the Cache Life tie.
Understanding RSS Syntax.
Introducing MagpieRSS.
Loading XML.
Parsing XML.
Introducing SOAP Messages.
Introducing PHP's SOAP Extension.
SafeMode.
Step1:UpdatetheWebSiteScripts.
Step2:CreatetheLocalizationRepository.
Step3:CreatetheTranslationFiles.
Step4:TranslatetheText.
Step5:GenerateBinaryFiles.
The Solar Framework.
The symfony Framework.
The Zend Framework.
Eim in atg Processing Ove head w this_cached) .
Creating Multiple Caches per Template.
Some Final Words About Caching.
Summary.
Why WebServices?.
Really Simple Syndication.
SimpleXMLL.
SOAP.
Summary.
Configuring PHP Securely.
Hiding Configuration Details.
Hiding Sensitive Data.
Sanitizing UserData.
Data Encryption.
Summary.
Introduction to SQL it.
PHP's SQLite Library.
CHAPTER 20Web Services.
CHAPTER 21 Secure PHP Programming.
U CONTENTS
CHAPTER 22SQLite.
CHAPTER 23 Building WebSites for the World.
CHAPTER 24MVC and the Zend Framework.
Other Security-Related Configuration Parameters
Hiding Apache.
Hiding PHP.
H ding the DocumentRoot.
Denying Access to Certain Fle Extensions
File Deletion.
Cross-Site Script ng.
Sanitizing UserInput The Solution.
Taking Advantage of PEAR:Validate.
PHP's Encryption Func tons.
The MCrypt Package.
Installing SQLite.
Using the SQLite Command-Lie Interface
sq te.assoc_case=01112.
Opening a Connection, .
Creating a Table in Memory
Closing a Connection.
Querying a Database.
Parsing ResultSets.