" As one of the leaders in the provision of web presence and network
solutions, we can offer our clients the most competitive prices available. "
Tue Apr 16 19:49:55 CEST 2024
  Search :   
TECHNICAL FAQ Technical FAQ Using CGI
NetCulture network information
The NetCulture speed commitment
Domain names explained
Secure transaction accounts (SSL)
FrontPage extensions
Administration of your account
Configuring POP accounts
The web language 'html'
Web page forms
Analysis of your web site
Page counters
Password protection
Automatic language detection
Using CGI
Using PHP for easy CGI
On-Line databases using MySQL
Mail handling on your account
Mailing lists (Majordomo)



CGI (Common Gateway Interface), is a method of embedding programs within your web server. A very simple example is shown below :-

#!/bin/sh
echo Content-type: text/plain
echo
echo 10 print "Hi There"
echo 20 goto 10
echo Hello there I see you saw my page at $HTTP_REFERER and came for a look.
echo You are using $HTTP_USER_AGENT as a browser.
echo $HTTP_USER_AGENT >> agentfile.txt
echo \<a href=\"http://mydomain.com\"\> Home \</a\>


Notice the \ escapes, the blank echo after the content-type line. Also If you want to use agentfile.txt line, remember to create a blank file first, and then use ‘$ chmod 755 agentfile.txt' to ensure that the permissions are set.

The full use of ‘cgi' can not be covered on our server, but we have put together an important checklist for those encountering problems when trying to run their scripts on the NetCulture site.


Checklist :-

  • Your script files must have the execute permissions set. This can be done using the command
    ‘$ chmod 755 scriptname'
  • The web server dictates that scripts must end in ‘.cgi' to ensure execution.
  • Any scripts that do not have the ‘Content Type' tag as the first line must be named ‘nph-scriptname.cgi'. The ‘nph-' stands for non-parsed-headers.
  • Perl 5 is located as ‘/usr/bin/perl' or ‘/usr/local/bin/perl'. You should make sure that the script header refers to the correct Perl location.
  • If you find that your Perl scripts do not run, check to ensure that the file was not uploaded using the BINARY format in ‘ftp'. The reason for this is that DOS based systems use ^M^L as an end of line definition, Unix systems do not. You can check this using either ‘vi' or ‘cat' to look at the file, if the end of lines show a ^M that will be the cause of the problem. Remember to upload all scripts using the TEXT format.
  • Scripts created for Perl 4 will need to have the characters ‘@' and ‘$' escaped to work correctly with Perl 5. This can be done using the backward slash as in ‘\@' and ‘\$'.
Site français
Contact us  |  Home
© 1996-2024 NetCulture.   All rights reserved.