Learnthat.com Free Certification and Computer Online Courses
ThatNetwork.com Internet Media Network Givethat.com free gift ideas Definethat.com - Free technical definitions, define Free Romance Tips, Romantic Tips, Date Ideas Free POD publisher comparison print on demand
Learnthat.com Free A+ Certification, Computer Classes, Certification Courses, Business, Lifestyle, ApplicationsFree business tutorials and definitionsFree certification tutorials and definitionsFree computer and technical tutorials and technical definitionsFree Finance Tutorials and DefinitionsFree House Repair TutorialsFree Lifestyle and Fun Tutorials
  All Online CoursesNew Courses QuickTipsWord DefinitionsSubmit a TutorialLinks
÷ Resources
Home
free tech tutorials
Free Tutorials
free tech tutorials
Certifications
free tech tutorials
Definitions
free tech tutorials
Resources/Links
free tech tutorials
Forums
free tech tutorials
Distance Education
free tech tutorials
Highest Rated Tutorials
÷ Popular Tutorials
÷ New Tutorials

Beginning CGI Programming with Perl

 

The CGI Programming Paradigm

Probably the two most common questions about CGI programming are, "What is CGI programming?" and "Why is CGI programming different from other programming?" The first question is the harder question to answer and certainly is the combination of all the pages in these tutorials, but there is a short answer: CGI programming is writing applications that act as interface or gateway programs between the client browser, Web server, and a traditional programming application.

The second question, "Why is CGI programming different from other programming?" requires a longer answer. The answer really needs to be broken up into three parts. Each part describes a different section of the CGI program's environment, and it is the environment that the CGI program operates under that makes it so different from other programming paradigms. First, a CGI program must be especially concerned about security. Next, the CGI programmer must understand how data is passed to other programs and how it is returned. And finally, the CGI programmer must learn how to develop software in an environment where his program has no built-in mechanisms to enable it to remember what it did last.

CGI Programs and Security

Why does your CGI program have to be so concerned about security? Unfortunately, your main concern is hackers. Your CGI programs operate in a very insecure environment. By their nature, your programs must be usable by anyone in the world. Also by their nature, they can be executed at any time of the day. And, they can be run over and over again by people looking for security holes in your code. Because the Net is a place where anyone and everyone has the freedom to search, play, and explore to his heart's content, your programs are bound to be tested eventually by someone with at least an overabundance of curiosity. This means that you must spend extra time thinking about how your program could be broken by a hacker. In addition, because many applications are written in an interpretive language like Perl, your program source code is easier to access. If a hacker can get at your source code, your code is at much greater risk.

The Basic Data-Passing Methods of CGI

The way data is sent back and forth across the Internet is one of the most unique aspects of CGI programming. Gathering data and decoding data are the subjects of Tutorials 4 and 5, respectively, but a brief introduction is warranted. Your CGI program cannot be designed without first understanding how data is built using the HTML hypertext link or the HTML Form fields. Both mechanisms create a unique environment in which data is encoded and passed based on both user input and statically defined data structures. When you design your CGI program, you first must design the user input format. This format is fixed in two data-passing mechanisms: the Get and Post methods. Both these methods use HTTP headers to communicate with your CGI program and to send your CGI program data. As you design your CGI program, you must be aware of the limitations of both these methods.

In addition, your CGI programs must be able to deal with the multiple input engines on the Internet, which have an impact on the format of the data your CGI program can return. Your CGI program can be called from all types of browsers-from the text-only Lynx program, the HTML 1.0-capable browsers, or the browsers like Netscape that include data (such as the cookie) that isn't even included in the HTTP specification. It is up to you to design your CGI program to deal with this multiplicity of client/browsers! Each will be sending different information to your CGI program, describing itself and its capabilities in the HTTP request headers discussed in Tutorial 2.

After you have the data from these myriad sources, your CGI program must be able to figure out what to do with it. The data passed to your CGI program is encoded so that it will not conflict with the existing MIME protocols of the Internet. You will learn about decoding data in Tutorial 5. After your CGI program decodes the data, it must decide how to return information to the calling program. Because not all browsers are created equal, your CGI program might want to return different information based on the browser software calling it. You will learn how to do this in the last part of Tutorial 2.

 

by Frontsource.com.pk

Find more free Internet tutorials from Learnthat.com.

More Information:

Help us by rating this tutorial: [---] [--] [+] [++] [+++]
[---] lowest; [+++] highest

 

 

 


Learn: Free Tutorials - Links to Free Tutorials
Understand: Free Technical Definitions - ExplainThat Whitepapers
Use: Certification Section - Discussion Forum

Visit Our Network Sites:

DefineThat.com Technical Defintions Romancetips.com
Free Gift Ideas - GiveThat Planthat.com Free Unique Business Ideas
PublishOnDemand.net - Learn about Print on Demand (POD) - Self Publishing Seekthat.com - Technical Search Engine
ThatNetwork.com  

About Us : Contact Us : Advertise : Privacy Information

© 1998-2004 Learnthat.com