www.it-ebooks.info Plug-in PHP www.it-ebooks.info About the Author Robin Nixon has worked with and written about computers since the early 1980s (his first computer was a Tandy TRS 80 Model 1 with a massive 4KB of RAM!). During this time he has written in excess of 500 articles for many of the UK’s top computer magazines. Plug-in PHP is his fourth book. Robin lives on the southeast coast of England with his wife, Julie, a trained nurse, and five children, where he also finds time to foster three disabled children, as well as working full time from home as a technical author. About the Technical Editor Todd Meister has been developing using Microsoft technologies for more than ten years. He has been a Technical Editor on more than 50 titles ranging from SQL Server to the .NET Framework. Besides technical editing titles, he is an Assistant Director for Computing Services at Ball State University in Muncie, Indiana. He lives in central Indiana with his wife, Kimberly, and their four charming children. www.it-ebooks.info Plug-in PHP 100 POWER SOLUTIONS Robin Nixon New York Chicago San Francisco Lisbon London Madrid Mexico City Milan New Delhi San Juan Seoul Singapore Sydney Toronto www.it-ebooks.info Copyright © 2010 by McGraw-Hill Companies. All rights reserved. Except as permitted under the United States Copyright Act of 1976, no part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the publisher. ISBN: 978-0-07-166660-2 MHID: 0-07-166660-5 The material in this eBook also appears in the print version of this title: ISBN: 978-0-07-166659-6, MHID: 0-07-166659-1. All trademarks are trademarks of their respective owners. Rather than put a trademark symbol after every occurrence of a trademarked name, we use names in an editorial fashion only, and to the benefit of the trademark owner, with no intention of infringement of the trademark. Where such designations appear in this book, they have been printed with initial caps. McGraw-Hill eBooks are available at special quantity discounts to use as premiums and sales promotions, or for use in corporate training programs. To contact a representative please e-mail us at bulksales@mcgraw-hill.com. Information has been obtained by McGraw-Hill from sources believed to be reliable. However, because of the possibility of human or mechanical error by our sources, McGraw-Hill, or others, McGraw-Hill does not guarantee the accuracy, adequacy, or completeness of any information and is not responsible for any errors or omissions or the results obtained from the use of such information. TERMS OF USE This is a copyrighted work and The McGraw-Hill Companies, Inc. (“McGraw-Hill”) and its licensors reserve all rights in and to the work. Use of this work is subject to these terms. Except as permitted under the Copyright Act of 1976 and the right to store and retrieve one copy of the work, you may not decompile, disassemble, reverse engineer, reproduce, modify, create derivative works based upon, transmit, distribute, disseminate, sell, publish or sublicense the work or any part of it without McGraw-Hill’s prior consent. You may use the work for your own noncommercial and personal use; any other use of the work is strictly prohibited. Your right to use the work may be terminated if you fail to comply with these terms. THE WORK IS PROVIDED “AS IS.” McGRAW-HILL AND ITS LICENSORS MAKE NO GUARANTEES OR WARRANTIES AS TO THE ACCURACY, ADEQUACY OR COMPLETENESS OF OR RESULTS TO BE OBTAINED FROM USING THE WORK, INCLUDING ANY INFORMATION THAT CAN BE ACCESSED THROUGH THE WORK VIA HYPERLINK OR OTHERWISE, AND EXPRESSLY DIS- CLAIM ANY WARRANTY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. McGraw-Hill and its licensors do not warrant or guarantee that the functions contained in the work will meet your requirements or that its operation will be uninterrupted or error free. Neither McGraw-Hill nor its licensors shall be liable to you or anyone else for any inaccuracy, error or omission, regardless of cause, in the work or for any damages resulting therefrom. McGraw-Hill has no responsibility for the content of any information accessed through the work. Under no circumstances shall McGraw-Hill and/or its licensors be liable for any indirect, incidental, special, punitive, consequential or similar damages that result from the use of or inability to use the work, even if any of them has been advised of the possibility of such damages. This limitation of liability shall apply to any claim or cause whatsoever whether such claim or cause arises in contract, tort or otherwise. www.it-ebooks.info www.it-ebooks.info www.it-ebooks.info www.it-ebooks.info This page intentionally left blank www.it-ebooks.info For Julie www.it-ebooks.info [...]... through how to set up your own web development server on a PC, Mac, or Linux computer, while the second shows how best to integrate the plug-ins into your own programs xxv www.it-ebooks.info xxvi Plug-in PHP: 100 Power Solutions About PHP PHP was originally developed in 1994 by Rasmus Lerdorf to replace a set of Perl scripts he had been using to maintain his personal web site The acronym originally stood... xxvii xxviii Plug-in PHP: 100 Power Solutions What This Book Provides Having access to all of PHP s functions isn’t very useful when you need to quickly put together a project to a tight deadline, because the functions typically provide very specific functionality Even PEAR plug-ins are not always the complete solution either, since they usually take time to learn and still must be wrapped in PHP code... web site, too, and you can list each plug-in on screen with color-highlighted syntax This makes it very easy to see the structure of each program When you wish to, you can click a link to copy and paste a particular plug-in right into your own programs Or, if you prefer, you can download all of the plug-ins to your computer from where you can pick the one(s) to upload to your own web site To help you... directly to your computer What Is and Isn’t Included Although the first aim of this book is to provide newcomers to PHP with a comprehensive resource of functions and routines to draw on, it has a secondary goal, which is to help you move up to the next level and to create your own programming toolkit Therefore every plug-in is thoroughly documented and explained in detail, and advice is given on ways to. .. publisher Companion Web Site A companion web site (at www.pluginphp.com) accompanies this book, where all 100 plug-ins are available to download, along with example code for you to experiment with The site also includes useful extras such as an 80,000-word dictionary and a geo-location IP data file www.it-ebooks.info xxix xxx Plug-in PHP: 100 Power Solutions The web site is best used in conjunction with this... this book comes into its own, because it provides 100 ready -to- go plug-ins you can simply drop into your programs and use, normally with a simple, single call Of course, because all projects are different I only provide the bare bones needed and leave layout and styling to the absolute minimum This leaves you free to grab a plug-in, insert it into your own program, and then tailor it to your exact requirements... How to Use It The Plug-in 111 112 112 112 113 114 114 114 114 115 115 116 116 www.it-ebooks.info xiii xiv Plug-in PHP: 100 Power Solutions Plug-in 33: Create Captcha About the Plug-in ... How to Use It The Plug-in www.it-ebooks.info 141 142 142 143 143 143 144 144 144 145 145 145 145 145 146 146 146 147 147 148 148 149 149 150 150 151 151 151 152 152 153 154 155 155 155 157 158 159 160 160 160 161 162 163 164 164 164 165 166 xv xvi Plug-in PHP: 100 Power Solutions Plug-in 49: RSS to HTML... www.it-ebooks.info xxi xxii Plug-in PHP: 100 Power Solutions Plug-in 97: Google Translate About the Plug-in Variables, Arrays, and Functions How It Works How to Use It The Plug-in ... may wish to create member areas protected by usernames and passwords, or want to write a simple Guestbook and so on Using Plug-in PHP, you will learn how to do all these things and much more using very simple ready-made PHP It is never assumed that you already know something, so you are taken through each subject step by step with full explanations, making sure you never have to go elsewhere to find . Kimberly, and their four charming children. www.it-ebooks.info Plug-in PHP 100 POWER SOLUTIONS Robin Nixon New York Chicago San Francisco Lisbon London. rights in and to the work. Use of this work is subject to these terms. Except as permitted under the Copyright Act of 1976 and the right to store and retrieve