TurnKey Internet Provides Fully Managed Dedicated and Virtual Private Servers Dedicated Servers | Virtual Servers | Colocation | Managed Services | Support | About

Using CGI Scripts (Perl, Unix shell, etc.)

The most common way to create dynamic content is to use CGI (Common Gateway Interface), which is the web server that executes a program generating an HTML page as output. There are two methods used to pass information (such as the content of the input fields in a form) to the program: GET and POST. The information is encoded and needs to be decoded. There are common libraries for Perl, C, etc. for handling CGI input.

In your web page you need to reference the CGI either as link or as ACTION in the form tag if the CGI is supposed to handle a form. Example:

<FORM METHOD="POST"
ACTION="http://www.yourdomain.com/cgi-bin/file.pl">

On NT web servers, script file extensions are associated with the interpreter for the language (e.g. - .pl files are associated with Perl and will be directly executed).

On Unix web servers, the scripts need to begin with #! and the interpreter location (e.g. Perl scripts must start with the line #!/usr/local/bin/perl ). Also, the scripts must have executable permissions for the web server - after you upload the scripts, FTP to your web server with your username and password, and change the permissions to 755. Some FTP programs support changing permissions with a function named “chmod” or simply “change permissions.”

Would you like to...

Print this page Print this page

Email this page Email this page

Post a comment Post a comment

Subscribe me

Add to favorites Add to favorites

Remove Highlighting Remove Highlighting

Edit this Question

User Opinions (5 votes)

100% thumbs up 0% thumbs down

How would you rate this answer?



Thank you for rating this answer.

Related Questions

Attachments

No attachments were found.

Visitor Comments

No visitor comments posted. Post a comment

Post a comment

To post a comment for this question, simply complete the form below. Fields marked with an asterisk are required.
   Name:
   Email:
* Comment:
* Enter the code below:
 

Continue