![]() |
Accessing CGI Program![]() ![]() ![]() ![]() ![]()
What does the server do when it receives a request to run a CGI program? The client has no way of knowing that the user wants to access a CGI program fact, the client never knows the type of request the user is making. When the browser sends the request, it makes no difference to the browser vvhether the user wants to receive an image file or an audio file or the HTML output of a C program. When the browser receives a response, then it is important to know the data type of the information so that the browser can display it properly. The server must determine whether the request is for a CGI program or not, and then take the appropriate action. Servers can determine whether a request is'.a CGI program in several different ways largely dependent on the server platform common way is for the server to check the directory of the request. some (such as the NCSA server) assume that any requests for items in the cgi bin directory are requests for CGI programs. Another common method is!,, look at the extension of the data requested: many servers assume that programs that end in the extension cgi are CGI programs.
The server cannot assume that the document requested is a CGI program eve, if the request is embedded in a form. For example, suppose you have the following form:
When this form is submitted, the server receives a request to post the input to the file /index. html. It cannot assume that/index.html is a CGI program; otherwise, it will try and run /index.html and will fail. Instead, it first looks at the URI and determines whether the URL specifies a CGI program or not. In this case, the server realizes it doesn't and sends an error message back to the browser stating that you cannot post to a file.
|
|
CGI
Advantages of CGI
How CGI Works
Compiled Versus Interpreted
Input to CGI
CGI Introduction Program
HTML Forms
Accepting Input from the Browser
CGI Environment Variables
Get Versus Post Method
Get Method
Post Method
Sample <FORM> Based CGI Program
Complete Example for <FORM>
Output from CGI
Header and Body:Anatomy of Server Response
HTTP Headers
Carriage Returns and Newlines
Formatting Output CGI Common MIME TypesLocation Header Useful HTTP Stautus Codes Other Headers Dynamic Pages Sending Images Displaying the Current Date Feedback Form Program Server Side Includes Server Side Include Environment Variables Displaying the Date with Date Counter Example of SSI Counting the Number of Accesses Better Approach Towards CGI Program Client Versus Server Accessing a HTML Document Submitting a Form Accessing a CGI Program Databases ODBC Creating a DSN Win32::ODBC Module Creating a Table Inserting Data into a Table Deleting Data from a Table
Updating Data in a Table
Selecting Data from a Table Operating Systems Security Securing Your Web Server Writing Secure CGI ProgramWeb DesignDomain Names Home
FAQ
My Account
IP Address
SSL Certificates DNSWeb Hosting Web Server Cheap Web Design Dedicated web hosting Managed web hostingE Commerce Principles of E-Commerce E-Banking Electronic Payment System E-Security Credit Cards Smart Cards
The Mailbox POP Server SMTP Server IMAP Protocol |
| Home | Web Hosting | Web Design | Sitemap |
| Copyright (C) 2007. Web Domain design hosting. All rights reserved. |