Cover image for Web Site Cookbook

Book description

The total number of web pages today has been estimated at over 3 billion, spanning millions of individual websites. Not surprisingly, there is tremendous pressure on web developers and designers to remain current with the latest technologies.

The Web Site Cookbook from O'Reilly covers all the essential skills that you need to create engaging, visitor-friendly websites. It helps you with the practical issues surrounding their inception, design, and maintenance. With recipes that teach both routine and advanced setup tasks, the book includes clear and professional instruction on a host of topics, including:

  • registering domains

  • ensuring that hostnames work

  • managing the directory

  • maintaining and troubleshooting a website

  • site promotion

  • visitor tracking

  • implementing e-commerce systems

  • linking with sales sites

This handy guide also tackles the various elements of page design. It explains how to control a reader's eye flow, how to choose a template system, how to set up a color scheme, and more.

Typical of O'Reilly's "Cookbook" series, the Web Site Cookbook is written in a straightforward format, featuring recipes that contain problem statements and solutions. A detailed explanation then follows each recipe to show you how and why the solution works. This question-solution-discussion format is a proven teaching method, as any fan of the "Cookbook" series can attest to.

Regardless of your strong suit or your role in the creation and life of a website, you can benefit from the teachings found in the Web Site Cookbook. It's a must-have tool for advancing your skills and making better sites.

Table of Contents

  1. Web Site Cookbook
    1. SPECIAL OFFER: Upgrade this ebook with O’Reilly
    2. Preface
      1. Assumptions
      2. Other Sources
      3. Conventions Used in This Book
      4. How to Contact Us
      5. Safari® Enabled
      6. Acknowledgments
    3. 1. Web Server Setup
      1. Introduction
      2. 1.1. Registering a Domain Name
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      3. 1.2. Managing and Protecting a Domain Name
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      4. 1.3. Choosing a Server Platform and Hosting Plan
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      5. 1.4. Enabling Server-Side Includes
        1. Problem
        2. Solution
        3. Discussion
      6. 1.5. Setting the Default Filename for a Directory or Entire Site
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      7. 1.6. Making Sure Your Web Site Loads With and Without the "www" Prefix
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      8. 1.7. Creating and Accessing Directories Outside the Web Site Root Directory
        1. Problem
        2. Solution
        3. Discussion
      9. 1.8. Automating Routine Tasks
        1. Problem
        2. Solution
        3. Discussion
          1. Tweaking your crontab
      10. 1.9. Restarting Your Web Server
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      11. 1.10. Monitoring Web Server Activity
        1. Problem
        2. Solution
        3. Discussion
          1. Using tail to track web site requests in real time
          2. Using grep to find specific requests in the web server log
          3. Using ps to monitor web server processes
        4. See Also
      12. 1.11. Building an Easy-to-Maintain Web Site with Free Tools
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
    4. 2. Site Planning and Setup
      1. Introduction
      2. 2.1. Writing a Functional Specification for Your Site
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      3. 2.2. Assessing Available Materials for a Site
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      4. 2.3. Organizing Your Files in Directories
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      5. 2.4. Establishing a Naming Convention for Your Files
        1. Problem
        2. Solution
        3. Discussion
          1. Index pages
          2. Subpages
          3. Images and movies
          4. Downloadables
        4. See Also
      6. 2.5. Establishing a Naming Convention for Page Titles
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      7. 2.6. Establishing a Naming Convention for Your Variables
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      8. 2.7. Downloading All Files from a Site
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      9. 2.8. Making URLs Easy to Find and Remember
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      10. 2.9. Creating a Flowchart for Complex Site Functionality
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
    5. 3. Page Design and Navigation
      1. Introduction
      2. 3.1. Choosing Between a Flexible and Fixed Layout
        1. Problem
        2. Solution
        3. Discussion
          1. Flexible layouts
          2. Fixed layouts
        4. See Also
      3. 3.2. Creating a Color Scheme
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      4. 3.3. Making Room for All Your Navigation
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      5. 3.4. Designing Pages for Advertisements
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      6. 3.5. Expanding Your Web Site
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      7. 3.6. Adding Background Images
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      8. 3.7. Creating Breadcrumb Links
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      9. 3.8. Creating a Link Menu to Other Pages
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      10. 3.9. Creating Navigation That Does Not Link to Itself
        1. Problem
        2. Solution
        3. Discussion
    6. 4. Formatting Text and Code
      1. Introduction
      2. 4.1. Writing Standards-Compliant Web Pages
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      3. 4.2. Displaying Foreign and Special Characters
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      4. 4.3. Choosing Type Sizes for Display and Body Text
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      5. 4.4. Including Dynamic Content in Static Pages
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      6. 4.5. Adding a Discretionary Hyphen to Long Words
        1. Problem
        2. Solution
        3. Discussion
      7. 4.6. Dividing a Text Block into Multiple Pages
        1. Problem
        2. Solution
        3. Discussion
      8. 4.7. Reformatting Database Content as HTML
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      9. 4.8. Optimizing Web Page Code
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
    7. 5. Formatting Graphics
      1. Introduction
      2. 5.1. Optimizing Your Images
        1. Problem
        2. Solution
        3. Discussion
          1. Graphics Interchange Format (GIF)
          2. Joint Photographic Experts Group (JPEG)
          3. Portable Network Graphic (PNG)
        4. See Also
      3. 5.2. Creating a Web-Friendly Logo
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      4. 5.3. Slicing and Recombining Complex Images
        1. Problem
        2. Solution
        3. Discussion
          1. Netscape Navigator image display quirks
        4. See Also
      5. 5.4. Choosing Clip Art and Stock Photos
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      6. 5.5. Disabling Image Download
        1. Problem
        2. Solution
        3. Discussion
          1. Disable right-click with JavaScript
          2. Disable the Internet Explorer image toolbar
          3. Use layers to put a transparent force field over your images
          4. Limit listing and linking
          5. Commercial solutions
      7. 5.6. Creating Watermarked Images on the Fly
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
    8. 6. Displaying and Delivering Information
      1. Introduction
      2. 6.1. Explaining Who's Responsible for Your Site
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      3. 6.2. Writing Meaningful Link Text
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      4. 6.3. Adding Preview Information to Links
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      5. 6.4. Creating Effective Pop-up Windows
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      6. 6.5. Randomizing Text or Images
        1. Problem
        2. Solution
        3. Discussion
      7. 6.6. Highlighting the Search Term
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      8. 6.7. Embedding RSS Feeds on Your Site
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      9. 6.8. Creating an RSS Feed from Database Content
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      10. 6.9. Adding a Poster Frame to a QuickTime Movie
        1. Problem
        2. Solution
          1. Creating a poster frame
        3. Discussion
        4. See Also
      11. 6.10. Creating a Printer-Friendly Version of Your Site
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      12. 6.11. Generating Downloadable Files Dynamically
        1. Problem
        2. Solution
        3. Discussion
          1. Using PDFlib
          2. Using GD Graphics Library
          3. Using R&OS PDF class
        4. See Also
      13. 6.12. Offering Your Site on Mobile Devices
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
    9. 7. Interacting with Visitors
      1. Introduction
      2. 7.1. Preventing Blank Form Fields
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      3. 7.2. Duplicating Form Field Data
        1. Problem
        2. Solution
        3. Discussion
      4. 7.3. Using Sample Input to Reduce Errors
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      5. 7.4. Formatting User-Entered Information
        1. Problem
        2. Solution
        3. Discussion
          1. Capitalizing names
          2. Fixing phone numbers
        4. See Also
      6. 7.5. Generating Form Menu Choices from a Database
        1. Problem
        2. Solution
        3. Discussion
      7. 7.6. Storing Multiple Values in One Database Field
        1. Problem
        2. Solution
        3. Discussion
      8. 7.7. Using a Graphical Character String for Form Authentication
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      9. 7.8. Putting Additional Information in mailto Links
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      10. 7.9. Send Visitor Messages to Your Mobile Phone
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      11. 7.10. Using Cookies to Remember Visitor Choices
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      12. 7.11. Internationalizing Your Web Site Problem
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      13. 7.12. Creating an Email Newsletter
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
    10. 8. Promotion and E-Commerce
      1. Introduction
      2. 8.1. Turning Site Traffic into Loyal Visitors and Customers
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      3. 8.2. Creating an Effective Landing Page
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      4. 8.3. Creating a Favicon
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      5. 8.4. Forcing a Secure Connection
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      6. 8.5. Creating a Self-Signed SSL Certificate
        1. Problem
        2. Solution
        3. Discussion
          1. Create a certificate authority key
          2. Create a self-signed certificate authority certificate
          3. Generate two private web server keys: one with a password and one without
          4. Generate a certificate request
          5. Sign the certificate request
          6. Enable SSL on the web server
          7. Add SSL directives to the Apache configuration file
        4. See Also
      7. 8.6. Disabling a Form Submit Button After the First Click
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      8. 8.7. Creating Complex Select Menus with optgroup
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      9. 8.8. Protecting Your Site from Fraud
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      10. 8.9. Generating Income from Traffic and Content
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      11. 8.10. Tracking and Blocking Visitors Based on Their IP Numbers
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      12. 8.11. Soliciting Donations and Contributions
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
    11. 9. Maintenance and Troubleshooting
      1. Introduction
      2. 9.1. Handling Requests for Missing or Relocated Pages
        1. Problem
        2. Solution
        3. Discussion
          1. Creating a custom error page
          2. Redirecting users to a new page
          3. Redirecting requests to a new directory
          4. Page-specific redirects
        4. See Also
      3. 9.2. Adding the Referring Page to a Form
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      4. 9.3. Improving Site Performance
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      5. 9.4. Tracking and Documenting Site Changes
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      6. 9.5. Modifying an Auto-Indexed File List to Match Your Site's Design
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      7. 9.6. Converting Source Documents to Web Pages
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      8. 9.7. Coordinating Site Updates and Testing
        1. Problem
        2. Solution
        3. Discussion
          1. Copying files with Perl
          2. The update_web site function
        4. See Also
      9. 9.8. Taking Care of Your Database
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      10. 9.9. Evaluating Your Site with Metrics
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      11. 9.10. Developing Test Procedures for Your Site
        1. Problem
        2. Solution
        3. Discussion
          1. Usability testing
          2. Browser testing
          3. Quality assurance
          4. Load testing
        4. See Also
      12. 9.11. Preventing Email Address Harvesting
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
    12. About the Author
    13. Colophon
    14. SPECIAL OFFER: Upgrade this ebook with O’Reilly