If you build web pages you may eventually want to add a guestbook, order form, page counter, or other interactive elements to your website. CGI Programming 101 explains how to do this in simple, easy-to-understand terms. The book shows you how to write useful, real-world web programs, starting with simple guestbook forms and building up to more advanced applications.
You'll learn:
* The Basics: where to write your CGI programs; how to upload them and set file permissions; how to run them, and how to debug them when things go wrong
* How to decode form data and save it to a file or e-mail it to yourself
* How to create, read, write, and search data files
* How to use Server-Side Includes to add dynamic content to your web site, plus a complete list of Apache SSI directives
* How to use random numbers for displaying banner ads and random images
* How to redirect visitors to another site
* How to extend your programs by using modules
* How to create a MySQL database, and write programs that interact with databases using the DBI module
* How to build an online shopping cart program
* How to e-mail attachments using a CGI program
* How to write secure programs, and protect your programs against hackers and spammers
* How to password-protect an area of your website
...and more.
The second edition has been substantially revised, with 100 pages of new material. It teaches good programming practices from the beginning, including use of the industry-standard CGI.pm Perl module. You'll learn how to protect your form-to-mail programs from being hijacked by spammers, how to build a cookie-based shopping cart, and how to develop a password-protected website. Quick-reference pages and an improved index help you find information easily.
There are also several online tutorials to help you set up your own web server and write CGI programs on any computer system - including Windows, Mac OS X, and Unix.
"synopsis" may belong to another edition of this title.
Jackie Hamilton has been programming Perl since the "early" days of the web (since 1992). She's tackled CGI projects for many companies, including Texas Metronet, Tenagra, Cybersight, GTE, EDS, and Texas Instruments, to name a few. She's currently the webmaster for Steve Jackson Games.
Introduction
This book is intended for web designers, entrepreneurs, students, teachers, and anyone who is interested in learning CGI programming. You do not need any programming experience to get started - if you can write HTML, you can also write CGI programs. If you have a web page, and want to write CGIs, then this book is for you. What is CGI? "CGI" stands for "Common Gateway Interface." CGI is the method by which a web server can obtain data from (or send data to) databases, documents, and other programs, and present that data to viewers via the web. More simply, CGI is programming for the web. A CGI can be written in any programming language, but Perl is the most popular, and for the course of this book, Perl is the language we'll be using. Why learn CGI? If you're going to create web pages, then at some point you'll want to add a counter, a form to let visitors send you mail or place an order, or something similar. CGI enables you to do that and much more. From mail-forms and counter programs, to the most complex database scripts that generate entire websites on-the-fly, CGI programs deliver a broad spectrum of content on the web today. If you've ever looked at a site such as Amazon.com, DejaNews, or Yahoo, and wondered how they did it... the answer is CGI. CGI experience is also in high demand from employers now; you could substantially improve your salary and job prospects by learning CGI. Why use this book? This book will get you up and running in as little as a day, teaching you the basics of CGI scripts, the fundamentals of Perl, and the basics of processing forms and writing simple CGIs. Then we'll move on to advanced topics, such as reading and writing data to and from files, searching for data in a file, writing advanced multi-part forms like order forms and storefronts, using randomness to spice up your pages, using server-side includes, cookies, and other useful CGI tricks. Things you probably have thought beyond your reach, things you thought you had to pay a programmer to do... all of these are things you can easily write yourself, and this book will show you how. Also included are several appendices that will be invaluable references, including a list of other online Perl resources, CGI job search sites, and tutorials for Unix, password-protection, and imagemaps. You can also try this course before buying the book; the first six chapters are available online, free of charge, at http://www.cgi101.com/class/. What do you need to get started? This book is written for the programmer using Perl on a Unix system. Don't worry if you're not familiar with Unix; this book will teach you all you need to know. Each chapter will show you the Unix commands you need to use with your CGIs, and there's also a Unix command reference and tutorial in Appendix B. If you don't already have access to a Unix account, you can get one from a number of ISPs, including cgi101.com, which offers telnet-only shell accounts and virtual hosting with access to CGIs, CGI helper modules, and a library of ready-to-use scripts. Visit www.cgi101.com for more information. If you are using Windows NT instead of Unix, you can still use most of the programs in this book, and learn Perl just as easily. Most NT machines run the same Perl code that Unix machines will. But some of the examples will not work for you, since they are intended for Unix. The Perl Reference for Windows (http://www.perl.com/reference/query.cgi?windows) has some links to websites that can help you get started using CGIs on a Windows system. You will need a Telnet client to connect to your Unix host of choice. If you are using a Windows PC, you should already have Telnet installed; if you aren't sure where it is, go under Start -> Find and type "Telnet". Then click on the Telnet.exe application to launch Telnet. If you are using a Mac, there are a number of free or shareware Telnet programs available online, including BetterTelnet (http://www.cstone.net/%7Erbraun/mac/telnet/), dataComet (http://www.databeast.com/), and NiftyTelnet (http://andrew2.andrew.cmu.edu/dist/niftytelnet.html). All of the code examples in this book are available on the web at http://www.cgi101.com/book/. You can download any or all of them from there, but do try writing the scripts yourself first; you'll learn faster that way. The website also includes some related utilities and a library of ready-to-use CGI programs, plus a mailing list you can join to get updates of new material. Conventions Used in this Book All Perl and HTML code will be set apart from the text by indenting and use of a fixed-width font, like: print "This is a print statement.\n"; All programs printed in the book are followed by a link to their respective source code: * Source code: http://www.cgi101.com/class/chX/script.txt In most cases, a link to a working example is also included: * Working example: http://www.cgi101.com/class/chX/demo.html Each chapter also has its own web page at http://www.cgi101.com/class/chX, where X is the chapter number. The full texts of chapters 1-6 are online; other chapters include only an index to the CGI scripts and HTML forms from that chapter. So, turn to Chapter 1, and let's get started writing CGIs!
"About this title" may belong to another edition of this title.
FREE shipping within U.S.A.
Destination, rates & speedsSeller: Wonder Book, Frederick, MD, U.S.A.
Condition: Very Good. Very Good condition. 2nd edition. A copy that may have a few cosmetic defects. May also contain a few markings such as an owner's name, short gifter's inscription or light stamp. Seller Inventory # D15J-00864
Quantity: 1 available
Seller: SecondSale, Montgomery, IL, U.S.A.
Condition: Very Good. Item in very good condition! Textbooks may not include supplemental items i.e. CDs, access codes etc. Seller Inventory # 00088024813
Quantity: 1 available
Seller: SecondSale, Montgomery, IL, U.S.A.
Condition: Good. Item in good condition. Textbooks may not include supplemental items i.e. CDs, access codes etc. Seller Inventory # 00087550605
Quantity: 1 available
Seller: HPB-Red, Dallas, TX, U.S.A.
Paperback. Condition: Good. Connecting readers with great books since 1972! Used textbooks may not include companion materials such as access codes, etc. May have some wear or writing/highlighting. We ship orders daily and Customer Service is our top priority! Seller Inventory # S_319903964
Quantity: 1 available
Seller: BooksRun, Philadelphia, PA, U.S.A.
Paperback. Condition: Good. 2. Ship within 24hrs. Satisfaction 100% guaranteed. APO/FPO addresses supported. Seller Inventory # 0966942612-11-1
Quantity: 1 available
Seller: HPB-Diamond, Dallas, TX, U.S.A.
Paperback. Condition: Very Good. Connecting readers with great books since 1972! Used books may not include companion materials, and may have some shelf wear or limited writing. We ship orders daily and Customer Service is our top priority! Seller Inventory # S_433865770
Quantity: 1 available
Seller: WeBuyBooks, Rossendale, LANCS, United Kingdom
Condition: Good. Most items will be dispatched the same or the next working day. A copy that has been read but remains in clean condition. All of the pages are intact and the cover is intact and the spine may show signs of wear. The book may have minor markings which are not specifically mentioned. Ex library copy with usual stamps & stickers. Seller Inventory # wbb0022335329
Quantity: 1 available
Seller: BennettBooksLtd, North Las Vegas, NV, U.S.A.
paperback. Condition: New. In shrink wrap. Looks like an interesting title! Seller Inventory # Q-0966942612
Quantity: 1 available