Sams teach yourself CGI in 24 hours

著者

    • Colburn, Rafe

書誌事項

Sams teach yourself CGI in 24 hours

Rafe Colburn

Sams Pub., c2000

タイトル別名

Teach yourself CGI in 24 hours

CGI in 24 hours

大学図書館所蔵 件 / 1

この図書・雑誌をさがす

内容説明・目次

内容説明

Sams Teach Yourself CGI in 24 Hours teaches you the next step beyond simple HTML Web pages. This new edition covers implementing CGI with both C and Perl, and it discusses CGI's relative strengths and weaknesses in comparison with other Web programming technologies like JavaScript, Java, and PHP. The book takes you from the basics of CGI--learning, for example, how to implement and customize existing CGI programs that have been written by others--to the point where you can use CGI to create your own programs from scratch. The book also provides numerous real-life examples of CGI scripts, such as database search tools, survey forms, interactive games, order forms, guest books, and more.

目次

Introduction. I. AN INTRODUCTION TO CGI. Hour 1. Overview of CGI Programming. Types of Web Applications. A History of CGI. What Is a CGI Program? How CGI Programs Work. How Resources Are Requested. Fulfilling the Request. Passing Data to a CGI Program. Pros and Cons of CGI. CGI Programming Languages. Perl. UNIX Shell. The C Language. Visual Basic. Python. Java. Summary. Q&A. Workshop. Quiz. Hour 2. Setting Up Your CGI Environment. The Web Server Itself. Hosting Your CGI Scripts. Running Your Own Web Server. Web Hosting. Web-Server Operating Systems. UNIX. Windows NT. The CGI Environment. Web Servers. Web-Server Directory Structure. How Scripts Are Executed. Setting Up Your CGI Development Environment. Step 1: Download a Web Server. Step 2: Install the Web Server. Step 3: Download a Perl Interpreter. Step 4: Install the Perl Interpreter. Step 5: Get the Web Server Up and Running. Step 6: Test the Web Server. Step 7: Test a Perl CGI Script. What if Something Went Wrong? Summary. Q&A. Workshop. Quiz. Exercises. Hour 3. Downloading, Installing, and Debugging CGI Scripts. Downloading Scripts From the Internet. Finding the Scripts You Need. What to Look for in Publicly Available Scripts. Installing a Downloaded Script. Example: Downloading and Installing a Guestbook Script. Configuring the Script. Installing the Files and Setting Permissions. Testing the Script. Customizing the Look and Feel. Debugging CGI Scripts. Finding the Source of an Error. Fixing Setup Errors. Checking Your Headers. Tools and Techniques for Debugging Your Program Code. Compiled versus Interpreted Languages. Running CGI Scripts from the Command. Using Print Statements for Debugging. Summary. Q&A. Workshop. Quiz. Exercises. Hour 4. Writing Your First CGI Program. Parts of CGI Programs. A Sample CGI Program. A URL-Redirection Program. How File Redirection Works. Pipes. Working With Files in Perl. Loops in Perl. The if Statement. Perl Expressions. Summary. Q&A. Workshop. Quiz. II. CAPTURING USER INPUT. Hour 5. Creating HTML Forms. The Tag. The ACTION Attribute. The METHOD Attribute. The ENCTYPE Attribute. The TARGET Attribute. The Tag. Text Input Fields. Password Fields. Check Boxes. Radio Buttons. Hidden Fields. File Upload Fields. Reset Buttons. Submit Buttons. Using Images as Submit Buttons. Other Form Fields. Text Areas. Select Lists. Workshop: Building an Entire Form. Elements in the Survey Form. Summary. Q&A. Workshop. Quiz. Exercises. Exercise Solutions. Hour 6. Processing Input. A Little Bit About HTTP. The GET Method. The POST Method. Choosing Between GET and POST. Handling Script Arguments. Processing Form Data. Reading Data from the Form. Dividing the Data into Name and Value Pairs. Splitting Names from Values. A Sample Script that Manually Decodes Form Data. Using CGI.pm to Decode Form Data. A Sample Script that Uses CGI.pm. Sending Input to CGI Programs via Extra Path Information. Using Extra Path Information. CGI Environment Variables. Summary. Q&A. Workshop. Quiz. Exercises. Hour 7. Validating User Input. Using JavaScript for Form Validation. How JavaScript Works to Validate Forms. An Example of Form Validation. The Form Itself. The Event Handler. Designing Easily Validated Forms. Incorporating Validation into the Form-Processing Code. How a Form-Processing Program Works. An Example of Form Processing. The Main Script Logic. The Input Validation Subroutine. The Output Subroutine. The Form Creation Subroutine. The Full Source Code. Validating Values. Regular Expressions. An Example that Uses Regular Expressions. Summary. Q&A. Workshop. Quiz. Exercises. Hour 8. Creating an Email Feedback Form. What Kinds of Applications Entail Sending Email? How Email Works. Mail Message Composition. Using sendmail. Using sendmail with Perl. Example: Sending Email from a CGI Script. Setting Things Up. The Application Logic. Validating the Form. Sending the Email Message. Using Blat. Using Blat from Perl. Summary. Q&A. Workshop. Quiz. Exercises. III. CGIPROGRAMMING LANGUAGES AND TOOLS. Hour 9. CGI and Simple Shell Scripting. Writing Shell Scripts. How Shell Scripts Work. Creating Gateways to UNIX Commands. Decoding Form Data. Working with Query Strings. Writing a Program That Uses the Query String. Un-CGI. Installing Un-CGI. How the Form Data Is Handled. Handling Multivalue Fields. Summary. Q&A. Workshop. Quiz. Exercises. Hour 10. Perl-The Big Kahuna of CGI Programming. CGI.pm. Accessing CGI.pm from Your Program. Decoding Form Data via CGI.pm. Named Image-Input Fields. Multiple Select Lists. File Upload Fields. Generating HTTP Headers and HTML Tags via CGI.pm. How to Generate HTTP Headers. How to Generate HTML Tags. cgi-lib.pl. Replacing cgi-lib.pl with CGI.pm. Handling Errors with CGI::Carp. Sending Fatal Errors to the Browser. Resources for Perl Programmers. Perl Documentation. Perl Information On the Web. Perl Books. The Comprehensive Perl Archive Network. Summary. Q&A. Workshop. Quiz. Exercises. Hour 11. Other Popular CGI Programming Languages. Will My Favorite Language Work for CGI? Writing CGI Programs in C. The cgic Library. Printing Headers. Printing Output. Handling Form Input. A C Example. Writing CGI Programs in Python. A Python Example. Summary. Q&A. Workshop. Quiz. Hour 12. Pros and Cons of Alternate Technologies. Looking Back. Why CGI Alternatives Appeared. Getting Past CGI's Limitations. Types of CGI Alternatives. Active Server Pages. ActiveX Components. Scripts. HTML Pages. Other ASP Platforms. Allaire ColdFusion. ColdFusion Sample Code. The Apache mod_perl Module. Porting Your Scripts from CGI to mod_perl. PHP. Examples Using PHP. Server-Side Java. Summary. Q&A. Workshop. Quiz. Exercises. IV. BUILDING BASIC CGI APPLICATIONS. Hour 13. Using Flat Files for Data Storage. What Is a Database? Flat-File Databases. Delimiting Data Using Characters. Delimiting Data Using Field Widths. File Operations. Retrieving Records from a Database. Inserting a Record into a Database. Deleting Records from a Database. Modifying a Record in a Database. File Locking. Building a Database Application. The Sample Database. Retrieving Records from the Database. Inserting a Record into the Database. Deleting Records from the Database. Modifying a Record in the Database. Summary. Q&A. Workshop. Quiz. Exercises. Hour 14. Creating a CGI-Based Message Board. The Structure of the Application. The File Format. The Display Script. Utility Subroutines. Parsing a Topic File. Printing the Topic List. Printing a Topic. The Posting Script. Presenting the New Topic Form. Processing a New Topic Submission. Adding a Response. Summary. Q&A. Workshop. Quiz. Exercises. Hour 15. Session (State) Management. Why Use Session Management? Basic Authentication. Hidden Fields in Forms. Hidden Form Fields Example. Application Logic. Printing the Hidden Fields. Using Cookies. How Cookies Work. Using Cookies to Save User Information. Using Cookies to Retrieve User Information. Setting and Retrieving Cookies with JavaScript. Session Management with Cookies. The Catalog Page. The Checkout Form. Why CGI and Cookies Don't Mix. Summary. Q&A. Workshop. Quiz. Exercises. Hour 16. Building a Simple Shopping Cart. How the Sample Shopping Cart Works. The Catalog. Printing the Catalog. Adding Items to the Shopping Cart. The Contents of the Shopping Cart. Printing the User's Cart. Removing an Item from the Cart. Checkout. The Checkout Script for this Example. Summary. Q&A. Workshop. Quiz. Exercises. Hour 17. Content Publishing with CGI. Why Content Publishing? Separating Content and Presentation. Building in an Editorial Process. Types of Content Publishing Systems. Data Storage for Content Publishing Systems. A Content Publishing Example. The Story-Input Program. The Story-Display Program. Third-Party Content Management Systems. Vignette StoryServer. Mason. Userland Frontier. Zope. Summary. Q&A. Workshop. Quiz. Exercises. V. INTEGRATING DATABASES AND CGI. Hour 18. Working with Relational Databases. The Relational Database Model. Structured Query Language. Statements for Data Manipulation. Statements for Data Definition. Statements for Database Administration. Database Design. Characteristics of Good Databases. Symptoms of Bad Databases. The Design Process. Creating a Database. Choosing Which Database to Access. Creating a Table. Relational Data Types. String Data. Numeric Data. Temporal Data. Summary. Q&A. Workshop. Quiz. Exercises. Hour 19. How to Use the Structured Query Language. Structured Query Language. The SELECT Statement. Joins. Adding, Deleting, and Modifying Records. Database Interfaces. ODBC. DBI and DBD. A Sample Program Using DBI and DBD. Summary. Q&A. Workshop. Quiz. Exercises. Hour 20. Creating an Online Store. The Database Design. The Catalog Script. Opening and Closing Database Connections. Displaying the Product List. Adding Items to the Shopping Cart. The Shopping Cart Script. Displaying the Shopping Cart. Removing Items from the Shopping Cart. The Checkout Script. Storing Orders in the Databas. Summary. Q&A. Workshop. Quiz. Exercises. VI. ADDITIONAL CGI TIPS AND TRICKS. Hour 21. Working with HTTP. HTTP Basics. What Takes Place During an HTTP Session. Step 1: Establish a TCP Connection. Step 2: The Web Browser Sends a Command to the Server. Step 3: The Web Browser Sends Request Headers. Step 4: The Web Server Responds. Step 5: The Web Server Sends Response Headers. Step 6: The Web Server Sends the Data to the Browser. Step 7: The Web Server Closes the TCP Connection. Server Response Codes. Response Headers. Cache-control. Content-length. Content-type. Expires. Pragma. Server. Set-Cookie. NPH Scripts. Content Types. How Servers Use Content Types. Content-Type Categories. Nonstandard Types. Secure Connections. Summary. Q&A. Workshop. Quiz. Exercises. Hour 22. Securing CGI Scripts. Why Security? The Crack-a-Mac Contest. Risk Assessment. Securing Your Web Server. Keep Your Software Up-to-Date. Store Your CGI Scripts Together. File Permissions. Server Options That Are Bad for Security. Common CGI Security Holes. A Note on How CGI Works. The Buffer Overflow Problem. Don't Send Raw Input to Shell Commands. Using File Paths Is Risky. Don't Place the Perl Interpreter in cgi-bin. Security Hole with DOS Batch Files. Keep Your Server Information Private. Safe Programming. Running Shell Commands Without Using the Shell. Summary. Q&A. Workshop. Quiz. Exercises. Hour 23. Creating Custom Error Documents. What Is an Error Document? Configuring Your Web Server for Custom Error Documents. The Apache Web Server. Netscape Web Servers. Using HTML to Create a Basic Error Document. Using CGI to Create an Advanced Error Document. Environment Variables for Error Documents. Linking Back from the Error Document to the Referring Page. Creating Custom Links from the Error Document. Handling a "Not Found" Error. Handling an "Unauthorized" Error. Summary. Q&A. Workshop. Quiz. Exercises. Hour 24. Server Side Includes. How Server Side Includes Work. Setting Up Your Web Server for SSI. Apache and NCSA. Netscape Web Servers. Microsoft Internet Information Server. O'Reilly's WebSite. WebStar. Using SSI Directives. flastmod. SSI Directives. #echo. #include. #fsize. #exec. #config. Designing Pages Using SSI. Using the #include Directive. Last Modified Dates. Using the #exec Directive. XSSI. printenv. set. if Directives. Summary. Q&A. Workshop. Quiz. Exercises. Appendixes. Appendix A: Answers. Appendix B: MIME Types. Appendix C: Response Codes and Reason Phrases. Appendix D: Environment Variables and Request Headers. Appendix E: Summary of Regular Expressions. Appendix F: The ASCII Character Table. Index.

「Nielsen BookData」 より

詳細情報

ページトップへ