Are You Wasting Time?

I wasted about 3 years when I first started on the internet.

The first website I built was on free web hosting. Never got more than 2 visitors a day and never made a penny.

Then I tried a web host that I didn't know anything about.
OOPS!
A BIG mistake and another waste of valuable time. My website was down half the time and when I tried to leave they stole my domain name.

I don't want you to make the same mistakes I made. That's why I only recommend top quality, dependable web hosting providers.

I recommend 3 in different price ranges:
Yahoo SB
$11.95 to $39.95

HostPapa
$5.95 to $7.95

CafW Hosting
$4.19 to $10.95

I recommend all 3 for quality and dependability.


CGI Script

What is a CGI script?

A CGI script is like a program. It is a collection of lines of code that contain instructions for a computer. Programs, however are compiled so that they will run faster on a particular OS. CGI scripts are just simple text files that are interpreted as needed. CGI scripts are smaller and simpler than programs.

CGI scripts can be written in Perl, PHP, C, Visual Basic, Python or whatever. Perl and PHP seem to be the languages of choice. That's because they are easy to learn and are very portable.

Not all Perl scripts are CGI scripts. Only Perl Scripts that follow CGI protocol are CGI scripts.

Sample Perl/CGI Script

The CGI script written in Perl has a very simple structure. The CGI script shown below would print the words Hello World to the PC screen. The shebang line tells the browser where to find the Perl interpreter on the server. The content header tells the browser what kind of content to expect.

#!perl #shebang line
print "Content-type:text/html\n\n"; #Content Header

print <<End_of_Doc;
<html>
<head><title></title></head>
<body>
Hello World
</body>
</html>
End_of_Doc

Sample PHP Script

To do the same thing with PHP the code is:

<html><head></head>
<body>
<?php print "Hello World"; ?>
</body>
</html>

PHP/MySQL

PHP is especially useful when working with relational databases and MySQL. For information on this subject, visit our PHP/MySQL Tutorial.

CGI Scripts and HTML Forms

One common use of a CGI script is to process the data collected on an HTML Form. A form contains input devices. Text boxes, textareas, check boxes, radio buttons and selection boxes are all examples of these input devices. The name of the the processing CGI script is placed in the action attribute of the form structure.
<form method="POST" action="cgi-bin/parse_post.pl">
In this section of code a CGI script named parse_post.pl found in the cgi-bin directory is named in the action attribute.

The browser accesses the CGI script when the Submit button on the form is pressed.

Free HTML Form Template Kit

You can download our free form template kit. The kit includes a form for receiving personal information from a user and 2 CGI scripts for processing the data. There is an actual active demo of the HTML form on the page so you can try it out.