You are previewing FileMaker Web Publishing: A Complete Guide to Using the API for PHP.
O'Reilly logo
FileMaker Web Publishing: A Complete Guide to Using the API for PHP

Book Description

FileMaker Web Publishing offers an unparalleled development strategy for database managers, web designers, and programmers who are interested in getting the most out of FileMaker databases on the web. The book introduces the basics of HTML, cascading style sheets, and PHP, then moves on to specific concepts such as database portals, value lists, and complex navigation systems. Advanced topics include uploading and referencing files within the database and sending dynamically formatted emails.

Table of Contents

  1. Contents
  2. Acknowledgments
  3. Introduction
    1. FileMaker and PHP — the Dynamic Duo
    2. What Do I Need to Know to Get Started?
    3. Do I Need to Know FileMaker?
    4. Do I Need to Know PHP?
    5. What Do I Need to Use This Book?
    6. Sample Files and Videos
    7. Last Thoughts
  4. Chapter 1 Introduction to Web Publishing with FileMaker
    1. Why PHP and FileMaker?
    2. What’s So Great about PHP?
    3. Requirements
      1. Macintosh
      2. Windows
    4. Interface Differences
    5. Summary
  5. Chapter 2 Setting Up Your Web Server
    1. What You Need to Write and Test Your PHP Pages
    2. Local or Remote Testing
    3. Choosing a PHP Script Editor
      1. Dreamweaver
      2. TextWrangler
      3. Nvu
    4. Setting Up IIS on Windows
    5. Setting Up Apache on Mac
    6. PHP Installation Options
    7. Testing Your PHP Installation
    8. Summary
  6. Chapter 3 Setting Up FileMaker Server
    1. Single Computer Installation of FileMaker Server 9
    2. Multiple Computer Installation of FileMaker Server 9
      1. The Worker Computer
      2. The Master Computer
    3. Deployment Assistant
    4. Manually Installing the FileMaker API for PHP
    5. Testing Your Installation
    6. Summary
  7. Chapter 4 Configuring FileMaker Server Admin Console
    1. FileMaker Server Admin Console
    2. Summary
  8. Chapter 5 Preparing Your FileMaker Database for the Web
    1. Creating the Blog Database
    2. Creating the Tables
    3. Creating the Fields for Each Table
      1. The Posts Table
      2. The Commenters Table
      3. The Comments Table
      4. The Categories Table
      5. The Relationships
    4. Adding Value Lists to the Database
    5. Layout Mode
    6. Portals
    7. Setting Up the FileMaker Accounts
    8. Summary
  9. Chapter 6 HTML Basics
    1. HTML Review
    2. What Do I Need to Get Started?
    3. Website Folder Setup
      1. Exercise 1 — Adding a Title
      2. Exercise 2 — Working with Headers
      3. Exercise 3 — Text Manipulation
      4. Exercise 4 — Adding Emphasis
      5. Exercise 5 — Formatted Lists
      6. Exercise 6 — Images
      7. Exercise 7 — Sending Emails with a Link
      8. Exercise 8 — Anchors Aweigh!
      9. Exercise 9 — Tables
      10. Manipulating Cell Data
      11. Creating Clickable Links in a Table
      12. Adding Images to Tables
      13. Working with <rowspan> and <colspan>
      14. Nested Tables
      15. Changing Text and Background Colors of Cells
    4. I Never Meta Refresh I Didn’t Like
    5. Sending Emails from the Web
    6. Summary
  10. Chapter 7 CSS Basics
    1. Cascading Style Sheets
    2. Fonts
      1. Font Size
      2. Font Weight
      3. Font Style
    3. Margins
      1. Top and Bottom Margins
    4. Alignment
    5. Text Decoration
    6. Commenting Your Code
    7. Backgrounds
    8. Background Images
      1. Fixed Background Images
      2. Repeating Background Images
      3. Repeat-x
      4. Repeat-y
    9. Background Position
    10. Vertical Alignment
      1. Combining Vertical and Horizontal Alignment
    11. Background Property
    12. Multiple Style Sheets
    13. Summary
  11. Chapter 8 PHP Basics
    1. PHP Scripts
    2. Displaying Text
    3. Variables
    4. Hip Hip Array
      1. Creating a Simple Array
      2. Creating an Array with Keys
      3. Creating an Array by Specifying Each Index
      4. Replacing an Element in the Array
      5. Adding an Element to the End of the Array
      6. Removing an Element from the End of the Array
      7. Removing an Element from the Beginning of the Array
      8. Adding an Element to the Beginning of the Array
      9. Sorting an Array Ascending Alphabetically
      10. Sorting an Array Descending Alphabetically
      11. Separating and Printing the Array Elements as a Text String
    5. PHP Functions
    6. Conditions
    7. Includes
    8. Comments
    9. Quotes
    10. Special Characters
    11. Summary
  12. Chapter 9 Links and Forms
    1. What Type of Navigation Should You Use?
    2. GET and POST
    3. Links
      1. Relative Links
      2. Absolute Links
      3. Sending Data in a Link
    4. Forms
      1. Types of Form Elements
      2. Text
      3. Hidden
      4. Radio Buttons
      5. Check Boxes
      6. Select Lists
      7. Text Areas
    5. The Response Page
      1. Viewing the Passed Data
    6. Summary
  13. Chapter 10 Validation
    1. Validating the Existence of a Form Value
    2. Validating Empty Form Values
    3. Validating Numbers
    4. Validating String Length
    5. Validating Email Format
    6. Summary
  14. Chapter 11 What Is the API for PHP?
    1. What Is an API?
    2. A Little Bit of History
    3. Anatomy of the FileMaker API for PHP
    4. Summary
  15. Chapter 12 Creating the Blog and Performing a Simple Query
    1. What Is a Blog?
    2. Include File Structure of the Blog
      1. The Header and Footer Files
      2. Cascading Style Sheets
      3. The About Blob Section
      4. Preparing the Connection Include Folder
      5. Creating a Connection Include File
    3. Constructing the Blog Index Page
    4. Adding a Find All Command to List Posts
    5. Displaying a Simple Result Set
    6. Summary
  16. Chapter 13 Creating New Records and Sorting
    1. Record Creation Process
    2. New Record Command
    3. Building the Input Form
    4. Processing Form Data Correctly
    5. Understanding the POST and GET Functions
    6. Creating the New Record
    7. Sorting with the FileMaker API
    8. Adding Sorting to the Home Page
    9. Summary
  17. Chapter 14 Database Searches and Limits
    1. Beyond the Find All
    2. There Is Also a Find Any Command
    3. Anatomy of a Find
      1. About Find Parameters and Logical Operators
      2. Important Field Name Limitations
    4. Creating a Blog Search Form
    5. Creating the Results Page
    6. Adding Limits to the Search Results
      1. Using Skip Record Parameters
      2. Integrating Limits and Skip to Achieve Paging
    7. Exact Searches and Other Modifiers
    8. Adding a View Blog Post Link
    9. Viewing a Single Blog Post Record
    10. Summary
  18. Chapter 15 Editing and Deleting Records
    1. Overview of the Record Object
    2. Linking to a Single Editable Record
    3. Building Editable Forms
    4. Building the Edit Post Script
    5. Deleting Records
    6. Summary
  19. Chapter 16 Working with Data Portals
    1. Reviewing Related Records and Portals
    2. Related Record Portal Web Requirements
    3. Notable Limitations
    4. Portal Workflow within PHP
    5. Accessing a Related Set of Data
    6. Adding a New Related Record
    7. Isolating a Related Record
    8. Creating a Related Record Edit Link
    9. Isolating the Linked Related Record
    10. Editing a Related Record
    11. Deleting a Related Record
    12. Summary
  20. Chapter 17 FileMaker Value Lists
    1. What Are FileMaker Value Lists?
    2. Why Use FileMaker Value Lists on the Web?
    3. Requirements for Value Lists
    4. HTML Drop-downs, Radio Buttons, and Check Boxes
    5. Retrieving a Value List from the Database
      1. Building a Dynamic Value List Drop-down
      2. Building a Dynamic Value List Radio Button Set
      3. Building a Dynamic Value List Check Box Set
    6. Adding Empty Default Values
    7. Creating a Value List Driven Form
      1. Processing Form Results for Drop-downs and Radio Buttons
      2. Processing Form Results for Check Boxes
    8. Taking It to the Next Level — Selecting Values with PHP
      1. Creating the Commenter Find Request and Basic Form
      2. Selecting Drop-down Values
      3. Selecting Radio Button Values
      4. Selecting Checked Check Boxes
    9. Implementing the Edit Command
    10. Limitations of FileMaker Value Lists on the Web
    11. Summary
  21. Chapter 18 PHP Sessions
    1. What Are Sessions?
    2. Why Use Sessions?
    3. Using Sessions
    4. Session Example — Remembering Form Data
    5. Testing the Session Form Flow
    6. Summary
  22. Chapter 19 Creating Login Authentication Schemes
    1. Authentication Methods
      1. Table-based Authentication
      2. Account-based Authentication
    2. Table-based Authentication — Building the Login Form
    3. Table-based Authentication — Building a Protected Page
    4. Account-based Authentication — Implementation
    5. Detailed Overview of accountLogin Function
    6. Other Authentication Methods — Active Directory
    7. Troubleshooting Authentication Schemes
    8. Summary
  23. Chapter 20 File Uploads with PHP and FileMaker
    1. How Do File Uploads Work?
    2. Preparing a Form for a File Upload
    3. Accessing the File Upload with PHP
    4. Debugging File Uploads — Error Codes Explained
    5. Connecting Uploaded Files to FileMaker Data
    6. Important Limitations
    7. Summary
  24. Chapter 21 Sending Emails with PHP
    1. Anatomy of an Email
    2. Requirements for Sending Email from PHP
    3. Basic Email from PHP
      1. Adding a Proper From Address
      2. CC and BCC Address Headers
      3. Reply-To Address Headers
    4. Sending HTML Emails
    5. Custom Character Encodings
    6. Email Security and Post Data
    7. Building a Feedback Form
    8. Adding an “Email a Post” Option to the Blog
    9. Summary
  25. Chapter 22 Debugging Connectivity Issues
    1. Common Connectivity Issues
    2. Printing Debugging Information
      1. Checking the Database Authentication Credentials
    3. Investigating Specific Error Codes
    4. Local Firewalls
    5. Routers and ISPs
    6. Secure Connections
    7. DNS Issues and Dynamic IPs
    8. When in Doubt, Search the Web
    9. Summary
  26. Chapter 23 Wildcards
    1. What Wildcards Are Available?
    2. Entering Literal Wildcard Characters
    3. Replacing Wildcards through a Regular Expression
    4. Usage Examples
    5. Summary
  27. Chapter 24 Going Beyond the Basics
    1. Only the Beginning
    2. Things to Know before Continuing
    3. Experiment and Learn
    4. The Sky Is the Limit
  28. Appendix A FileMaker Error Codes
  29. Appendix B Additional Resources
    1. FileMaker Forums
    2. FileMaker Developer Tools
    3. FileMaker User Groups
    4. Web Editors
    5. Online Resources
    6. Useful PHP Classes
    7. FileMaker Hosting
    8. FileMaker News and Email Lists
    9. FileMaker Newsletters and Blogs
    10. FileMaker Web Training Classes
    11. FileMaker Web Consulting
    12. Web Publishing Books
    13. FileMaker Technical Network
    14. FileMaker Business Alliance
    15. FileMaker TechInfo Database
  30. Index