Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Debian GNU/Linux Reference Guide
Prev Home Next

13.8 Web

Basic interactive dynamic web pages can be made as follows:

  • Queries are presented to the browser user using HTML forms.

  • Filling and clicking on the form entries will send an URL with encoded parameters [ 65] from the browser to the web server. For example:

    • https://www.foo.dom/cgi-bin/program.pl?VAR1=VAL1&VAR2=VAL2&VAR3=VAL3

    • https://www.foo.dom/cgi-bin/program.py?VAR1=VAL1&VAR2=VAL2&VAR3=VAL3

    • https://www.foo.dom/program.php?VAR1=VAL1&VAR2=VAL2&VAR3=VAL3

  • CGI program (any one of program.*) on the web server will receive decoded parameters "VAR1=VAL1 VAR2=VAL2 VAR3=VAL3" as the contents of environment variable "QUERY_STRING" and executes itself.

  • stdout of CGI program will be sent to the web browser and is presented as an interactive dynamic web page.

For security reasons it is better not to hand craft new hacks for parsing CGI parameters. There are established modules for them in Perl (see Perl, Section 13.4) and Python (see Python, Section 13.5). PHP comes with these functionality. When client data storage is needed, cookies are used. When client side data processing is needed, javascript is frequently used.

For more, see The Common Gateway Interface, The Apache Software Foundation, and JavaScript.

Searching "CGI tutorial" on Google by typing encoded URL https://www.google.com/search?hl=en&ie=UTF-8&q=CGI+tutorial directly to the browser address is a good way to see the CGI script in action on the Google server.


Debian GNU/Linux Reference Guide
Prev Home Next

 
 
  Published under the terms of the GNU General Public License Design by Interspire