CGI – script writing

CGI – script writing

Article by Steisi

CGI script writing – Technology

Search by Author, Title or Content

Article ContentAuthor NameArticle Title

Home
Submit Articles
Author Guidelines
Publisher Guidelines
Content Feeds
RSS Feeds
FAQ
Contact Us

Today, such things as guest book, search on the server, form for sending of messages – are an essential attribute of any classifieds web-site.
The problem of implementing these and other technologies, of course, strongly excites the imagination of the novice webmaster. Unfortunately, the study of the HTML-sources of competitive pages does not give anything, except links to “cgi-bin”, and even in forums there is a mention of some cgi-scripts.
This article is devoted to the basics of using of these cgi-scripts for the prosperity of your site.
CGI-script – is a program that is run on the Web-server at the request of the client (i.e. Web-site visitors). This program has essentially no differences from conventional programs which are installed on your computer – whether it is MS Word or a game “Quake”.
This script is not a programming language, but Common Gateway Interface – a special interface, by means of which the script is run and interacted with it.
How does the CGI-script work? A visitor of your page fills the form, for example, for writing in the guestbook. After that, he presses the button “Submit”, which starts cgi-script. The script executes programmed actions – in this case it reads data from the form and writes it to the file of the guest book – and sends an ordinary HTML-code to the browser of the visitor.
The benefits of CGI-scripts to JavaScript and Java: as the program is running from server, it does not matter what browser the visitor has. There are no glitches and error messages;
cgi-scripts allow you to implement a much broader range of functions, code of cgi-script is closed for the competitors.
On what language can be written CGI-program?
The answer will surprise you: in anyone. The main thing is that the server can execute this program, that is, compiler or interpreter for the programming language must be installed on the server. For systems based on Unix, it is usually C / C + +, Perl, Shell; for servers running Windows NT – the same Perl, C / C + + and any Windows-programming system that supports writing of cgi-applications, for example, Visual Basic or Delphi. If you decide to use a compiler, for example, C / C + +, you will need to compile source code on the server.
In order to develop the scripts work on your site, you don not have special knowledge of programming language. There is a huge number of free scripts in the web.
Let’s suppose that you decide to use the downloaded from the web script.
To make it work properly you need to do the following:
At the beginning of the script you need to include some of the data required to run the script, for example, the path to the interpreter Perl (usually / usr / local / bin / perl / or just / usr / bin / perl /), URL of your site, the file name in which the results of the script execution will be written, etc. All the lines are usually marked with comments, so you can easily find them. Depending on the configuration of the Web-server, the name of the script must have a certain extension and / or script must be in a specific directory. For example, the name of the script must have the extension . cgi and script should be in the directory cgi-bin. You should consult with your server administrator about requirements for scripts.
As the script – is a program you should assign it the attribute “executable.”
If the script writes the data in any file (for example, the file of guest book), then the file must be writable.

About the Author

Steisi – is an online marketer with extensive knowledge in the field of online business. She helps software companies to make strategies for improving of Web Development. Steisi introduces Flynax Classifieds Software and Boat classifieds script web development company

Use and distribution of this article is subject to our Publisher Guidelines
whereby the original author’s information and copyright must be included.

Steisi



RSS Feed


Report Article


Publish Article


Print Article


Add to Favorites

Article Directory
About
FAQ
Contact Us
Advanced Search
Privacy Statement
Disclaimer

GoArticles.com

Get the book now