Web Scripting
Secret Weapons

Written by Scott Walter

C  O  N  T  E  N  T  S

Chapter 1   Browser Identification

Chapter 2   Plug-In Identification

Chapter 3   Tracking Hit Counts

Chapter 4   Saving Configurations with Cookies

Chapter 5   Creating Personalized Home Pages

Chapter 6   Controlling User Access

Chapter 7   Animating Images

Chapter 8   Advertising with Billboards

Chapter 9   Bulletin Boards

Chapter 10   Implementing Web Chat

Chapter 11   Implementing Keyword Searches

Chapter 12   Guestbook/Graffiti Wall

Chapter 13   Field Verification

Chapter 14   Form Processing

Chapter 15   Managing a Database

Chapter 16   Searching the Database

Chapter 17   Creating Online Catalogs

Chapter 18   Online Store Product Searches

Chapter 19   Shopping Cart

Chapter 20   Online Ordering

Chapter 21   Calendar of Events

Chapter 22   Creating Groupware Calendars

Chapter 23   Search Engine Front-End

Chapter 24   Designing an eZine

Chapter 25   Creating a Coloring Book

Chapter 26   Online Testing

Chapter 27   Power Scripting Toolkit

Appendix A   Online Resources

Appendix C   JavaScript Glossary


Web Scripting Secret Weapons

Copyright 1996 by Que Corporation.

All rights reserved. Printed in the United States of America. No part of this book may be used or reproduced in any form or by any means, or stored in a database or retrieval system, without prior written permission of the publisher except in the case of brief quotations embodied in critical articles and reviews. Making copies of any part of this book for any purpose other than your own personal use is a violation of United States copyright laws. For information, address Que Corporation, 201 W. 103rd Street, Indianapolis, IN 46290. You may reach Que's direct sales line by calling 1-800-428-5331.

ISBN: 0-7897-0947-3

HTML conversion by :
    M/s. LeafWriters (India) Pvt. Ltd.
    Website : http://leaf.stpn.soft.net
    e-mail : leafwriters@leaf.stpn.soft.net
PresidentRoland Elgey PublisherJoseph B. Wikert
Title Manager Jim MinatelEditorial Services Director Elizabeth Keaffaber
Managing Editor Sandy DoellDirector Of Marketing Lynn E. Zingraf
Acquisitions Manager Cheryl D. Willoughby Acquisitions Editor Philip Wescott
Product Director Stephen L. Miller Production Editor Sherri Fugit
EditorsKelli M. Brooks, Judy Ohm, Jade Williams Product Marketing Manager Kim Margolius
Assistant Product Marketing Manager Christy M. Miller Strategic Marketing Manager Barry Pruett
Technical Editor Matthew BrownTechnical Support Specialist Nadeem Muhammed
Acquisitions Coordinator Jane K. BrownlowSoftware Relations Coordinator Patty Brooks
Editorial Assistant Andrea DuvallBook Designer Ruth Harvey
Cover Designer Nathan Clement
Production Team Bryan Flores, Brian Grossman, Jason Hand, ,Bob Laroche, Erich Richter, Donna Wright
IndexerKevin Fulcher

About the Author

Scott J. Walter has been working in software development since 1986, moving from programmer to Director of Development for two different companies to freelance consultant, programmer, and Web Designer. Currently, he is Systems Administrator and Senior Programmer for Epic Media, a multimedia and online design firm. He coauthored the Complete Idiot's Guide to JavaScript, has written for BoardWatch magazine, and has been a contributing author to Special Edition Using JavaScript, Special Edition Using Backstage, JavaScript by Example, Special Edition Using Netscape Navigator 3.0, and other titles. When not surfing the Internet, Scott spends his spare time dabbling in (and writing about) Java, JavaScript, VBScript, ActiveX, VRML, Perl, HTML, Shockwave, and other budding Internet technologies.


I would like to thank a number of people for helping me with this book. At the top of the list is Philip Wescott, my acquisitions editor, who "cracked the whip" to help me keep this book in line. Jim Minatel deserves kudos for suggesting the idea of writing this book, as does Steve Schafer for suggesting me to write it. Finally, Matthew Walter, my brother, for putting up with some intense mood swings and occasional (okay-relatively frequent) calls in the night to check out one script or another.

We'd Like to Hear from You!

As part of our continuing effort to produce books of the highest possible quality, Que would like to hear your comments. To stay competitive, we really want you, as a computer book reader and user, to let us know what you like or dislike most about this book or other Que products.

You can mail comments, ideas, or suggestions for improving future editions to the address below, or send us a fax at (317) 581-4663. For the online inclined, Macmillan Computer Publishing has a forum on CompuServe (type GO QUEBOOKS at any prompt) through which our staff and authors are available for questions and comments. The address of our Internet site is http://www.mcp.com (World Wide Web).

In addition to exploring our forum, please feel free to contact me personally to discuss your opinions of this book: I'm 76103,1334 on CompuServe, and I'm smiller@que.mcp.com on the Internet.

Thank you in advance-your comments will help us to continue publishing the best books available on computer topics in today's market.

Stephen L. Miller
Product Development Specialist
Que Corporation
201 W. 103rd Street
Indianapolis, Indiana 46290


You've made the pilgrimage to your favorite bookstore on a regular basis and scanned the shelves, searching and hoping that somewhere you'll find a book on scripting. There are literally tons of books available-JavaScript, VBScript, ActiveX Script, Perl, CGI, HTML. The list continues to grow as fast as the presses can pump out new titles. Each new venture has its good points and bad but none seem to supply everything.

Until now.

As the arsenal available to Web site developers continues to grow, it becomes essential to converse in multiple languages. You now need to know a little of everything-a little client-side and a little server-side, much like a dash of Perl mixed with a helping of image animation. It's the only way to stay ahead of the game, keep up with the market, and make people want to visit your exciting pages again and again.

What This Book Is

Each chapter in Web Scripting Secret Weapons looks at a different facet of scripting the Web. As often as possible, more than one method of implementing a Web extension is presented, such as scripting an online store in Perl versus JavaScript. Each chapter in this book can stand on its own; however, you'll also find there may be references to other chapters for further exploration as well as suggestions and ideas on how to take the principles demonstrated and expand on them.

The Companion CD-ROM

This book is packed with source code examples, but before you start doing finger exercises in preparation for hours for typing, pop the companion CD-ROM in your drive. All source code listed within these pages (and much more) is available on the CD, so you shouldn't need to type a single line-simply download the files from the disk, edit them as you see fit, and you're off and running.

In addition, the companion CD-ROM contains:

What This Book Is Not

This is not a beginner's book, in the sense of teaching how JavaScript or Perl work, for example, and several assumptions are made:

This book doesn't intend to teach you about any particular scripting language; it is designed to show you how you can implement various Web technologies with these languages. There are plenty of books available that go through all the minute details of Perl, JavaScript, ActiveX, and so on; but, few take the next step and say, "Okay, now that you know what X is, this is what you can do with it."


All terms mentioned in this book that are known to be trademarks have been appropriately capitalized. Que Corporation cannot attest to the accuracy of this information. Use of a term in this book should not be regarded as affecting the validity of any trademark or service mark.