{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Server side scripting 8 cgi scripts follow a certain

Info icon This preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ks and use certain environment variables General structure of a CGI script has three main parts: Basics of CGI Scripting Part 1 receive, check, parse name/value pairs Part 2 decode name/value pairs and extract data Part 3 prepares the output to be sent back Initialization Set initial values of variables and read input Parsing Separate name/value pairs and isolate them Decoding Extract values of the names Output Prepare output based on the decision taken Server identify server parameters Request hold information in a request Client have all the information about the client Chapter 18 - Server-side Scripting The four tasks of a CGI script are: There are three groups of environment variables: 9 Universal CGI Scripts We can write a script once and use it in many web pages Examples of scripts that can be used and reused are: Script for parsing and decoding name/value pairs Page hit counters Sending of automatic e-mails Chapter 18 - Server-side Scripting 10 There are HTTP, e-mail, newsgroup, application, proxy, FTP, and Telnet Servers Each type of server uses a corresponding protocol HTTP servers are most common and serve websites A server hosts a database and responds to clients requests A web server runs on a stand-alone dedicated computer Web servers typically house and run CGI scripts from a cgi-bin directory Some web servers are free and some charge a fee The servers have to be maintained and backed up A server should be able to efficiently handle peak load Chapter 18...
View Full Document

{[ snackBarMessage ]}