You are previewing Integrating PHP with Windows®.
O'Reilly logo
Integrating PHP with Windows®

Book Description

Build PHP applications run efficiently and effectively with Windows. Packed with practical step-by-step exercises, this in-depth guide teaches you how to use PHP modules and functions with an array of Microsoft® technologies—including Internet Information Services (IIS), Microsoft® Exchange Server, Microsoft SQL Server®, and Active Directory®.

Table of Contents

  1. Integrating PHP with Windows®
  2. A Note Regarding Supplemental Files
  3. Introduction
    1. Who Should Read This Book
      1. Assumptions
    2. Who Should Not Read This Book
    3. Organization of This Book
    4. Conventions and Features in This Book
    5. System Requirements
    6. Code Samples
      1. Installing the Code Samples
      2. Using the Code Samples
    7. Acknowledgments
    8. Errata & Book Support
    9. We Want to Hear from You
    10. Stay in Touch
    11. Contacting the Author
  4. I. Internet Information Services (IIS)
    1. 1. Setting Up the Work Environment
      1. Setting Up IIS
        1. Installing IIS by Using the Server Manager
        2. Installing from the Command Line
      2. Setting Up PHP
        1. Installing PHP
        2. Available PHP Modules
      3. Configuring PHP in IIS
        1. Configuring PHP by Using the IIS Manager
        2. Configuring PHP from the Command Line
      4. Installing by Using the Web Platform Installer
        1. Setting Up the Web PI
        2. Setting Up IIS and PHP
        3. Checking Your PHP Installation
      5. Backing Up Your Configuration
      6. A First Sample Application
      7. Remote Access
      8. Summary
    2. 2. IIS Architecture
      1. Sites
        1. Setting Up a New Site
          1. Setting Up a Site by Using IIS Manager
          2. Setting Up a Site from the Command Line
          3. Testing Your New Site
        2. Adding Additional Bindings
          1. Adding Bindings by Using IIS Manager
          2. Adding Bindings from the Command Line
        3. Managing the Website
          1. Starting and Stopping a Website by Using IIS Manager
          2. Starting and Stopping a Website from the Command Line
      2. Applications
        1. Paths and Folders
        2. Setting Up a New Application
          1. Setting Up an Application by Using IIS Manager
          2. Setting Up an Application from the Command Line
        3. Changing Application Settings
      3. Virtual Directories
        1. Setting Up a Virtual Directory by Using IIS Manager
        2. Setting Up a Virtual Directory from the Command Line
      4. HTTP Request Flow
        1. Request Flow Overview
        2. Application Process Flow
      5. Modules
      6. Application Pools
        1. Setting Up Application Pools by Using IIS Manager
        2. Setting Up Application Pools from the Command Line
        3. Application Pool Identity
          1. Specifying Application Pool Identity by Using IIS Manager
          2. Specifying Application Pool Identity from the Command Line
      7. FastCGI
        1. FastCGI vs. CGI
        2. FastCGI vs. ISAPI
      8. Summary
    3. 3. Configuring IIS
      1. Configuration Files
        1. Global Configuration
        2. Distributed Configuration
      2. Configuration Structure
        1. Sections and Section Groups
        2. Elements and Configuration Listings
        3. Moving and Binding Sections
        4. The Configuration Editor
      3. Schema and configSections
      4. Configuring Paths by Using location
        1. Configuring by Using IIS Manager
        2. Configuring from the Command Line
      5. Sites, Applications, and Directories
        1. Sites
          1. Defining a Single Site
          2. Bindings
        2. Applications
        3. Virtual Directories
      6. Locking the Configuration
        1. Locking with configSections
        2. Locking and Unlocking with location
          1. Specifying Section Rights
        3. Specifying Rights for Individual Settings
          1. Example: lockAttributes
          2. Example: lockElements
          3. Example: lockItem
          4. Locking and Unlocking by Using appcmd
        4. Locking and Unlocking by Using IIS Manager
          1. Locking and Unlocking Sections
          2. Locking and Unlocking Features
      7. Summary
    4. 4. Configuring PHP
      1. Installing PHP Manager
      2. Configuring PHP
        1. Recognizing Configuration Changes
          1. Configuring by Using the IIS Manager
          2. Configuring from the Command Line
          3. Configuring by Using PHP Manager
        2. Path and Host-Dependent Configuration in php.ini
        3. Configuring by Using .user.ini
          1. Configuring by Using the Windows Registry
          2. Configuring a FastCGI Application
      3. Specifying the Default Document
        1. Specifying the Default Document by Using the IIS Manager
        2. Specifying from the Command Line
        3. Defining Directly in the Configuration
      4. Request Limits
        1. Configuring by Using the IIS Manager
        2. Configuring from the Command Line
        3. Configuring Directly in the Configuration File
      5. Time Limits for Request Processing
        1. PHP Limits
        2. FastCGI Limits
          1. Configuring by Using the IIS Manager
          2. Configuring from the Command Line
      6. Session Storage and Temporary Files
      7. Setting Up PHP Syntax Highlighting
        1. Configuring Syntax Highlighting by Using the IIS Manager
        2. Configuring from the Command Line
      8. Setting Up Different PHP Versions
        1. Installing a New PHP Version
        2. Configuring by Using the PHP Manager
        3. Configuring the Handler Assignment
          1. Configuring by Using IIS Manager
          2. Configuring from the Command Line
        4. Configuring the FastCGI Application
          1. Configuring by Using the IIS Manager
          2. Configuring from the Command Line
        5. Testing
      9. Setting Up Different PHP Configurations
      10. Summary
    5. 5. Security
      1. Structuring the Application
        1. Root Folder or Virtual Directory
          1. Setup in the Root Folder
          2. Setup with a Virtual Directory
        2. Specifying the Executable Files
          1. Configuring the Handler Assignment
          2. Configuring the Request Filter
          3. PHP Scripts in the Root Folder of the Public Zone
      2. PHP Configuration
      3. User Authentication
        1. Installing the Required Role Services
          1. Installing the Authentication Role Services by Using the Server Manager
          2. Installation via the Web Platform Installer
        2. Setting Up User Authentication by Using IIS Manager
        3. Setting Up User Authentication from the Command Line
        4. Windows Authentication and Host Names
          1. Local Authentication
          2. Authentication Against Active Directory
        5. Retrieving the Authentication in PHP
      4. Identity and Access Rights
        1. Identity of the Application Pool
        2. Path Logon Information
        3. Specifying the Identity of the Anonymous User
        4. Securing the PHP Application
      5. Authorization Rules
        1. Installing the Required Role Services
          1. Installing Authorization Role Services by Using the Server Manager
          2. Installation via the Web PI
        2. Defining the Rules by Using IIS Manager
        3. Defining the Rules from the Command Line
      6. Request Filter
        1. Defining General Settings
          1. Request Limits
          2. Character Filter
          3. Specifying the Settings by Using IIS Manager
          4. Specifying the Settings from the Command Line
        2. Filtering File Name Extensions
          1. Specifying the Settings by Using IIS Manager
          2. Specifying the Settings from the Command Line
        3. Filtering with Rules
          1. Setting up Filter Rules by Using IIS Manager
          2. Editing Filter Rules from the Command Line
      7. Encrypted Connections (HTTPS)
        1. Creating Keys and Certificates
        2. Setting up an Encrypted Connection
          1. Setting up the Binding
          2. SSL Settings
          3. Setting Up a User Certificate
          4. Querying Information with PHP
        3. Authentication with Client Certificates
          1. Installing the Required Role Services
          2. Activating the Client Certificate Assignment Authentication
      8. Summary
    6. 6. Caching
      1. Caching in the Web
        1. Caching for a Limited Time
          1. The Expires Header
          2. Max-Age Statement
        2. Mutable Contents
          1. Change Date
          2. Entity Tag
        3. Caching Conditions
        4. Specifying the Headers with IIS
          1. Specifying the Headers by Using IIS Manager
          2. Specifying Headers from the Command Line
          3. Configuration Elements
      2. Output Cache
        1. Configuring by Using IIS Manager
        2. Configuring from the Command Line
        3. Configuration Elements
      3. The WinCache Extension for PHP
        1. Setting Up the WinCache Extension
          1. Manually Installing the WinCache Extension
          2. Installing the WinCache Extension by Using the Web PI
        2. The PHP Opcode and File Cache
          1. Configuration
          2. Status Information
        3. Session Handler
        4. User Cache
      4. Summary
    7. 7. URL Rewrite
      1. Setting Up URL Rewrite
        1. Installing URL Rewrite Manually
        2. Installing URL Rewrite by Using the Web PI
      2. Predefined Variables
        1. Common Gateway Interface Variables
        2. IIS and PHP Variables
        3. Merging PHP Script
      3. Evaluating Rules
        1. Action Types
        2. Hierarchy and URL Paths
        3. Time of the Evaluation
      4. Setting Up Rules
        1. Setting Up Redirect Rules
          1. Flow
          2. Adding a Redirect Rule
        2. Setting Up Rewrite Rules
          1. Flow
          2. Adding a Rewrite Rule
        3. Additional Action Types
          1. Customizing a Reply
          2. The Abort Request Action Type
          3. The None Action Type
        4. Setting Up Rules with Templates
          1. User-Friendly URL
          2. Blocking Requests
      5. Rewrite Maps
        1. Creating a Rewrite Map
        2. Creating an Associated Rule
      6. Rules in Detail
        1. Patterns
          1. Wildcards
          2. Regular Expressions
          3. Testing Patterns
        2. Conditions
          1. Adding and Editing Conditions
          2. Back References
        3. Actions
          1. Variables
          2. Functions
        4. Setting Server Variables and HTTP Headers
        5. Outbound Rules
          1. Pre-Conditions
        6. Tag Filters
        7. Creating an Outbound Rule
      7. XML Configuration
        1. URL Rewrite
        2. Allowed Server Variables
        3. Rules
        4. Conditions
        5. Server Variables and HTTP Headers
        6. Actions
        7. Rewrite Maps
        8. Outbound Rules
        9. Single Outbound Rule
      8. Examples
        1. User-Friendly URLs
        2. Canonical Host Name
        3. Multilingual Pages
        4. Canonical User Directories
        5. Preventing the Embedding of Graphics on Foreign Sites
        6. Redirecting to HTTPS
        7. Adding a Notice to Each Page
      9. Converting from Apache mod_rewrite
      10. Summary
    8. 8. Error Messages and Error Search
      1. Detailed Error Messages
        1. Disabling Friendly Error Messages in Internet Explorer
        2. Enabling Detailed Error Messages
        3. PHP Error Output
      2. Tracing
        1. Installing the Tracing Role Service
        2. Enabling a Trace
          1. Enabling Tracing by Using IIS Manager
          2. Enabling Tracing from the Command LIne
        3. Configuring Logging Rules
          1. Defining Logging Rules by Using IIS Manager
          2. Configuring from the Command Line
        4. Trace Entries
      3. PHP Error Messages
        1. Outputting to STDERR
        2. PHP Messages in the Trace
        3. FastCGI and STDERR
      4. Determining the Causes of Server Problems
        1. The Server Can’t Be Reached
        2. PHP Scripts are not Executing
      5. Summary
  5. II. SQL Server
    1. 9. Setting Up SQL Server
      1. Installing SQL Server
        1. Configuring SQL Server
          1. Installing .NET Framework
          2. Installing SQL Server 2008 R2 SP1
        2. Installing SQL Server Express
          1. Manual Installation
          2. Installing with the Web Platform Installer
        3. Installing the SQL Server PHP Extension
          1. Manual Installation
          2. Installing by Using the Web PI
      2. SQL Server Tools
        1. SQL Server Management Studio
        2. The sqlcmd Command-Line Tool
        3. The T-SQL Batch
      3. Configuring for Remote Access
        1. Enabling the TCP/IP Protocol
        2. Sharing Access in the Windows Firewall
      4. Installing the Sample Database
      5. Migrating MySQL Databases
        1. Installing the Migration Assistant
          1. Installing the MySQL ODBC Driver
          2. Installing the SSMA
          3. Registering the SSMA
        2. Migrating a MySQL Database
      6. Summary
    2. 10. Databases and Tables
      1. Databases
        1. System Databases
        2. Database Structure
        3. Setting Up Databases
          1. Specifying Files and File Groups
          2. Examples
            1. Database with Default Settings
            2. Database with Alternative Sort Order
            3. Database with File Groups
          3. Setting Up a Database with SSMS
        4. Deleting a Database
        5. Creating a Snapshot
          1. Example
          2. Restoring the Database
          3. Deleting a Snapshot
      2. Data Types
        1. Numeric Data Types
        2. Strings and Binary Data
          1. Sorting and Code Page
        3. Dates and Times
        4. Other Data Types
      3. Schemas and Object Names
        1. Object Names
        2. Creating Schemas
        3. Deleting Schemas
      4. Tables
        1. Creating Tables
          1. Defining Columns
          2. Creating Tables by Using SSMS
        2. Deleting Tables
      5. Keys and Indexes
        1. Primary Keys
          1. Defining the Primary Key When Creating a Table
          2. Changing the Primary Key
          3. Defining the Primary Key by Using SSMS
        2. Foreign Keys
          1. Defining Foreign Keys
          2. Actions Based on Foreign Keys
          3. Defining Foreign Keys by Using SSMS
        3. Indexes
          1. Creating an Index
          2. Creating an Index by Using SSMS
          3. Deleting an Index
      6. Summary
    3. 11. Working with SQL Server
      1. Querying Data (SELECT)
        1. Simple SELECT Expressions
        2. Constraining Queries by Using WHERE
        3. Grouping Query Data (GROUP BY, HAVING)
        4. Sorting (ORDER BY)
        5. Queries with Multiple Tables
          1. Joining Tables (JOIN)
          2. Subqueries
        6. Common Table Expressions (WITH)
          1. Simple Expressions
          2. Recursive Expressions
        7. Paging Through Data
          1. TOP()
          2. ROW_NUMBER()
      2. Manipulating Data
        1. The INSERT Command
          1. Default Values
          2. The OUTPUT Clause
          3. Inserting by Using SSMS
        2. The UPDATE Command
          1. Specifying Which Rows to Change
          2. The OUTPUT clause
          3. Changing Values by Using SSMS
        3. The DELETE Command
          1. Errors During Deletion
          2. Deleting All Rows of a Table
          3. Deleting by Using SSMS
      3. Querying Metadata
        1. Listing Databases
        2. Listing Tables
        3. Retrieving Table Information
        4. Listing the Columns of a Table
        5. Listing Constraints
        6. Listing Keys and Indexes
      4. Summary
    4. 12. PHP and SQL Server
      1. Approach and Process
        1. Preparations
        2. The Sample Program
        3. An Overview of the Individual Steps
          1. Opening the Database Connection
          2. Sending the Query
          3. Retrieving the Result
          4. Freeing the Result Resource and Closing the Database Connection
        4. Supporting Script
      2. Database Connections
        1. Server Names
        2. Authentication
          1. Windows Authentication
          2. SQL Server Authentication
        3. Connection Pooling
          1. Fragmenting
          2. Connection Options
        4. More Connection Options
      3. Database Queries
        1. Parameterizing Statements
          1. SQL Injection
          2. Filtering and Masking Data
          3. Parameterizing Statements
          4. Sample Program
        2. Retrieving Results
          1. Retrieving as Object
          2. Retrieving Individual Fields
        3. Prepared Statements
      4. Data Types
        1. Converting from PHP to SQL Server
        2. Converting from SQL Server to PHP
        3. Streams
          1. Retrieving Data as Stream
          2. Inserting Data as Stream
        4. PDO and SQL Server
        5. PDO Database Access Lifecycle
        6. Connecting to SQL Server
        7. Direct Queries and Prepared Statements
        8. Retrieving Results
        9. Data Types and Streams
      5. Summary
    5. 13. Advanced Database Functions
      1. Full-Text Search
        1. Installing the Module
        2. Language Selection
        3. Creating the Catalog and the Index by Using SSMS
          1. Creating the Catalog
          2. Creating the Index
        4. Creating the Catalog and the Index by Using T-SQL
          1. Creating the Catalog
          2. Creating the Index
        5. Search with Full-Text Index
          1. Exact Search (CONTAINS/CONTAINSTABLE)
          2. Free-Text Search (FREETEXT/FREETEXTTABLE)
      2. Transactions
        1. T-SQL Transactions
        2. Transaction Isolation Levels
        3. PHP Transactions
        4. Transactions Using PHP Data Objects
      3. Stored Procedures
        1. Variables
        2. Defining Procedures
        3. Calling Procedures
        4. Output Parameters and Return Values
        5. Control Structures
        6. Calls from PHP
        7. Calling Stored Procedures from PDO
      4. Custom Functions
        1. Scalar Functions
        2. Table-Valued Functions
          1. Inline Table-Valued Functions
          2. Multi-Statement Table-Valued Functions
      5. Triggers
        1. Creating a Trigger
        2. Detailed Explanation
        3. Initiating the Trigger
      6. Summary
    6. 14. Users and Permissions
      1. SQL Server Principals
        1. Server Principals
          1. Login Types
          2. Server Roles
        2. Database Principals
          1. Database Users
          2. Database Roles
      2. Creating SQL Server Principals
        1. Creating Logins
          1. Creating Logins by Using SSMS
          2. Creating Logins by Using T-SQL
        2. Creating Users
          1. Creating Users by Using SSMS
          2. Creating Users by Using T-SQL
        3. Creating Database Roles
          1. Creating Database Roles by Using SSMS
          2. Creating Database Roles by Using T-SQL
      3. Objects and Permissions
        1. Permissions
          1. Effective Permissions
          2. Ownership Chains
        2. Managing Permissions by Using SSMS
          1. Defining Permissions Through Objects
          2. Defining Permissions Through Principals
        3. Managing Permissions by Using T-SQL
          1. Granting Permissions (GRANT)
          2. Explicitly Denying Rights (DENY)
          3. Revoking Permissions (REVOKE)
      4. Stored Procedures
        1. Security Through Permissions
        2. Execute as User
          1. Defining the User
          2. Required Permissions
      5. Summary
  6. III. Active Directory
    1. 15. Setting Up Active Directory
      1. Overview
        1. Domains
        2. Entries
      2. Installing Active Directory
        1. Preparation
        2. Installing the Role
        3. Installing the Domain Services
      3. First Steps
        1. Active Directory Domain Services
        2. Organizational Units
          1. Creating an Organizational Unit
          2. Defining Additional Properties
          3. Deleting an Organizational Unit
        3. Users
          1. Creating a User
          2. Changing the User Properties
          3. Deleting a User
        4. Groups
          1. Creating a Group
          2. Setting Members and Memberships
          3. Computer
      4. Setting Up Active Directory Certificate Services
      5. Working with Certificates
        1. Issuing a Certificate for Active Directory
          1. Issuing a Certificate
          2. Checking the Encrypted LDAP Access
        2. Exporting the Root Certificate
        3. Exporting Other Certificates
      6. Summary
    2. 16. LDAP Basics
      1. LDAP Basics
        1. Hierarchical Structure
        2. Classes and Inheritance
        3. Protocol Elements
      2. Utilities
        1. LDP
          1. Working with LDP
          2. Searching by Using LDP
          3. Changing Entries by Using LDP
        2. ADSI Edit
          1. Working with ADSI Edit
          2. Creating New Entries
      3. Configuring the PHP LDAP Extension
        1. Activating the LDAP Extension
        2. Communication Process
        3. Supporting Script
        4. Establishing an Encrypted Connection
          1. Configuring PHP and OpenLDAP
          2. Testing the Encrypted LDAP Connection
          3. Verifying the Connection Certificate
      4. Authenticating Users
      5. Querying Entries
        1. Sample Program: Searching for Domain Users
        2. LDAP Filter
          1. Operators
          2. Escape (Masking) Characters
          3. Examples
        3. Iterating Through Search Results
          1. Incremental Entry Queries
          2. Incremental Attribute Queries
      6. Summary
    3. 17. Searching in Active Directory
      1. The PHP LDAP Browser
        1. Main Program and User Interface
          1. Entry Form
          2. LDAP Search
          3. Evaluating the Search Results
          4. Viewing the Results
        2. Formatting an LDAP Entry
        3. Type Information and Search Definitions
        4. Conversion Functions
      2. The Directory Information Tree and Naming Contexts
      3. Active Directory Schema
        1. Object Classes
          1. Attributes of Object Classes
          2. PLB: Finding and Viewing Object Classes
          3. Object Classes vs. Object Categories
        2. Attribute Classes
          1. Attributes of Attribute Classes
          2. PLB: Finding and Viewing Attribute Classes
          3. Attribute Syntax
      4. Domain Objects
        1. General Attributes for Domain Objects
          1. PLB: General Search for Domain Objects
          2. PLB: Converting the Object GUID
          3. Users
          4. Personal Information
          5. Contact Information
          6. User Account Information
          7. PLB: Searching for Users
          8. PLB: SID Conversion
          9. PLB: Converting a Windows Timestamp in PHP
          10. PLB: Viewing the Account State
        2. Groups
          1. PLB: Searching for Groups
          2. PLB: Viewing the Group Type
        3. Organizational Units
      5. Concrete Search Examples
        1. Schema
          1. Attributes
            1. Search
              1. Explanation
            2. Search
              1. Explanation
            3. Search
              1. Explanation
            4. Search
              1. Explanation
            5. Search
              1. Explanation
            6. Search
              1. Explanation
          2. Object Classes
            1. Search
              1. Explanation
            2. Search
        2. ANR
        3. Users
          1. Search
            1. Explanation
          2. Search
            1. Explanation
          3. Search
            1. Explanation
          4. Search
            1. Explanation
          5. Search
            1. Explanation
          6. Search
            1. Explanation
        4. Groups
          1. Search
            1. Explanation
          2. Membership Through member/memberOf
            1. Search
              1. Explanation
            2. Search
              1. Explanation
            3. Search
              1. Explanation
            4. Search
              1. Explanation
          3. Membership Through primaryGroupID
            1. Search
              1. Explanation
            2. Search
              1. Explanation
      6. Summary
    4. 18. Writing in Active Directory
      1. Preparation
        1. Access Rights
          1. Administrator Groups
          2. Changing the Access Rights to an Entry
        2. Error Logging
        3. Supporting Scripts
          1. Main Program
          2. LDAPConnection
          3. The AD_util.php Script
      2. Writing Attributes
        1. Adding Attributes
        2. Deleting Attributes
        3. Changing Attributes
        4. Encoding and Character Sets
      3. Practical Examples for Changing Attributes
        1. Unlocking an Account
        2. Activating and Deactivating Accounts
        3. Group Memberships
          1. Adding a User to a Group
          2. Removing a User from a Group
        4. Forced Password Change
        5. Changing Passwords
      4. Writing Entries
        1. Adding New Entries
        2. Deleting Entries
        3. Moving Entries
      5. Practical Examples
        1. Creating a New Group
        2. Creating a New User
        3. Deleting a User or a Group
      6. Summary
  7. IV. Exchange Server
    1. 19. Setting Up Exchange Server
      1. Setting Up Required Services and Features
        1. General Requirements
        2. Configuring IIS
        3. Configuring Features
        4. Configuring Shared Ports
        5. Installing the Office System Converter
        6. Configuring DNS Entries
      2. Installing Exchange Server
      3. Configuration After the Installation
        1. Registering Exchange
        2. Configuring the Exchange Server Certificate
          1. Requesting the Certificate
          2. Issuing a Certificate
          3. Assigning Services to the Certificate
      4. Creating a Mailbox
      5. Summary
    2. 20. Exchange Web Services
      1. Required PHP Extensions
      2. Autodiscover
        1. How Autodiscover Searches for Configuration Data
        2. Configuration Data
        3. Retrieving Configuration Data
          1. Query with cURL
          2. Evaluating Configuration Data
        4. Alternative Methods for URL Queries
          1. Active Directory
          2. Exchange Management Shell
      3. SOAP and WSDL
        1. WSDL Structure
        2. EWS, WSDL, and PHP
          1. Adding the Service Definition
          2. Testing the Modified EWS WSDL File
      4. SOAP Messages
        1. ExchangeSoapClient Class
        2. Using the ExchangeSoapClient Class
      5. Information About the Following Chapters
        1. Shorter SOAP Messages
        2. Shorter PHP Listings
        3. Object-Oriented Alternative for Parameters
      6. Summary
    3. 21. Email and Exchange Web Services Basics
      1. Structure, IDs, and Views
        1. IDs of Labeled Folders
        2. Viewing Elements
        3. Selected Properties of Elements
        4. Names of Properties
          1. Basic Properties
          2. Property Groups
          3. Extended Properties
      2. Finding Folders (FindFolder)
        1. Selected Properties
        2. Request
        3. Response
          1. XML Response
          2. PHP Object
      3. Listing Messages (FindItem)
        1. Limiting the Results (Paging)
        2. Sorting
        3. PHP and Replacement Groups
          1. Type Mapping
          2. Modifying the Schema
        4. Request
          1. XML Request
          2. PHP
        5. Response
          1. XML Response
          2. PHP Object
      4. Viewing a Message (GetItem)
        1. Requesting the Exchange 2010 Mode Within a SOAP Header
        2. Defining and Filtering the Message Content
      5. Requesting the Original MIME Content
        1. Request
        2. Response
        3. Example
        4. Email Attachments (GetAttachment)
          1. Request
          2. Response
      6. Sending a Message (CreateItem)
        1. SOAP Errors Caused by References and Accessors
          1. Problem
          2. Solution
        2. Request
          1. XML Request
          2. Creating an Email by Using PHP
        3. Response
      7. Deleting Messages (DeleteItem)
        1. XML Messages
        2. PHP
      8. Summary
    4. 22. Contacts and Search
      1. Properties of Contacts
        1. Standard Properties
        2. Name Properties
        3. Properties of Email Addresses
        4. Address Properties
      2. Changing a Contact (UpdateItem)
        1. Request
          1. XML Request
          2. Creating the Request in PHP
        2. Response
      3. Finding Certain Properties
        1. Expressions
          1. Boolean Expressions
          2. Comparison Expressions
          3. Additional Expressions
        2. Preparation: Modifying the Schema
      4. Defining the Search in a Request
        1. Complete PHP Example
          1. The Search Form
          2. Creating the Search Parameters
          3. Contact Search
      5. Summary
    5. 23. Calendar and Impersonation
      1. Calendar Entries
        1. Standard Properties
        2. Meetings
        3. Recurring Appointments
        4. Time and Time Zones
          1. Time Format
          2. Specifying the Time for Requests
      2. Creating a Common Calendar Entry
        1. The Request Message
        2. The Response Message
        3. Created Entry
      3. Meetings
        1. Creating a Meeting
          1. The XML Request Message
          2. A Complete PHP Example
        2. Creating the Meeting Invitation
          1. The XML Structure
          2. Selected Properties
        3. Responding to a Meeting Invitation
          1. Accepting an Invitation
          2. Tentatively Accepting an Invitation
          3. Declining an Invitation
          4. A Complete PHP Example
        4. Canceling a Meeting
          1. The Request Message
          2. The Response Message
      4. Appointment Conflicts
        1. The Request Message
          1. The XML Request Message
          2. Using PHP to Identify Calendar Conflicts
        2. The Response Message
      5. Searching the Calendar
        1. The Request Message
        2. The Response Message
        3. A Complete PHP Example
      6. Impersonation
        1. Granting Impersonation Rights
        2. Impersonation in EWS Operations
          1. Impersonation by Using Principal Names
          2. Impersonation by Using Email Addresses
          3. Impersonation by Using Security IDs (SID)
      7. Additional Steps
      8. Summary
  8. A. Example Scripts and Data
    1. The HTMLPage Class
    2. The HTML Template
    3. The DatabaseConnection Class
    4. Example Database: AdventureWorksLT2008
  9. Index
  10. About the Author
  11. Copyright