Home ] Portfolio ] Contacts ] Domain Names ] Support ]

 

support

 

Support Home
CGI Scripts
FTP Details
Cookies
Client Side Errors

  
What is CGI?
CGI (Common Gateway Interface) is a method of using an ordinary web page to run a program on the web-space server, this program can be used for data processing, information display or almost anything else you want. With your webspace you automatically receive a CGI-BIN in which to store and run this kind of program, unlike some web-space providers this CGI-BIN is fully usable with no limitations on the type of program you can use. With this CGI-BIN you are given three free scripts, a counter, a log and a formmail script. These scripts are the more commonly used of the CGI scripts, and are simple to set-up, but as well as these, there are many other freely available scripts on the Internet. CGI allows you to bring feedback and interaction to your usually static web-pages, and although HTML is pretty simple to use, CGI is a lot more varied and therefore a lot more complicated. The best way to learn about CGI is to buy a book about it, which usually are thick and not cheap.

 

How to set-up the counter script
The counter script is automatically placed in the CGI-BIN folder in your web space when it is created, this script will display a number representing the amount of people that have accessed the page and will also display the date that the counter was started, giving you an idea of how many have people visited over a certain period of time. Below is an example of what a working counter would look like:-

00817 hits since

To enable the counter to work on a page, the page filename must have the extension '.shtml' instead of the usual '.html' or 'htm', this is because the counter uses a process called SSI (Server Side Includes). The '.shtml' signifies to the browser that it should expect an SSI command and therefore it is vital for the counter to work.

To use the script, create a page as usual and find a visible area suitable for placing the counter and then insert the line:-

<!--#exec cgi="/cgi-bin/counter/count.pl" -->

 

How to set-up the log script
The log script is automatically placed in the CGI-BIN folder in your web space when it is created, this script will save to a file the time, date, address, referring page (i.e. search engine) and the browser type of every visitor to the page that the log is on. Any visitor to the page will not be aware that the log script is being run from the page and there is no way for them to find out.

For the log script command to work properly the extension on the filename of the page must be '.shtml' instead of the usual '.html' or 'htm', this is because the counter uses a process called SSI (Server Side Includes). The '.shtml' signifies to the browser that it should expect an SSI command and therefore it is vital for the counter to work.

To use the script, create a page as usual and then insert the line:-

<!--#exec cgi="/cgi-bin/log/log.pl" -->

 

How do I set-up a visitor response form? (UNIX Only)
The visitor response form script on the ROCKMM Web servers is called 'Formmail', this works using a system known as CGI, and is in the form directory off the main cgi-bin directory. The formmail script only works on UNIX servers. Once the page is set-up your users will be to send you messages or requests to you using a form which will automatically email you any completed forms.

To use the script, you will need to create an HTML form with the following lines included as the main part of the form:

<form action="/cgi-bin/form/formmail.pl" method="POST" name="The name of the form">

This tells the browser which script to run and how to pass the data to it. The contents of the 'name' field is just a title by which the form will be known

<input type="hidden" name="email" value="web-form@your-company.co.uk">

This will provide the email response with a 'from' address.

<input type="hidden" name="realname" value="Your name">

This line gives the email in the 'from' line a more meaningful name. Both this and the previous line are unimportant and only really here to allow you to keep track of the responses.

<input type="hidden" name="recipient" value="your-name@your-company.co.uk">

Very important - you should set this to your email address so the data can be sent to you.

<input type="hidden" name="redirect" value="http://www.your.co.uk/thanks.htm">

Very important - you should set this to full address of the next page, which should usually be a thank you page.

<input type="hidden" name="subject" value="whatever">

This helps you to identify which page the information was sent from by placing a message in the subject of the email.

</form>

This signifies the end of the form.

Once you have the basic tags outlined above you can then add your form fields, you only need to keep in mind that everything for the form must be in between the opening and closing form brackets. Another line you may wish to add to your form will sort the data being sent back to you into the order you want, without this line the data will appear in a random order. Just add the following line:

<input type="hidden" name="sort" value="order:name_of_field1,name_of_field2,etc...">

Or you can use

<input type="hidden" name="sort" value="alphabetic">

In the first example the value field should contain the word 'order' followed by a colon and then the names of the fields of the form (the name in each <input type=" " name=" " value=" "> of the form).

 

Adding your own CGI scripts
With the UNIX space you have purchased from ROCKMM Web, you will receive a free fully working CGI-BIN, in this you can place any scripts you desire (within reason). Below are some items of information that you may find helpful.

Perl Scripts
To use Perl scripts on our server you will have to create them on a seperate system (or use a ready-prepared script) and then transfer them into your cgi-bin using FTP. When you're transfering the script you must make sure that the scripts are transfered in ASCII mode.

The address to the Perl Interpreter is : /usr/bin/perl

The permissions for any Perl scripts must be set to :-

User Read Write Execute
Group Read   Execute
Other Read   Execute

Other Useful Information

Telnet Access Unfortunately in the interests of security we do not allow our customers to have telnet access.
Server File Locations
    Date /bin/date
    Sendmail /usr/bin/sendmail
    Perl /usr/bin/perl