<!--#exec cmd=/usr/home/yourname/public_html/counter.cgi-->
As you can see, there is a *big* difference in this HTML "tag". It uses a
starting <!-- and a closing -->. What this does is hide the
actual code so it is not displayed on the page for one, and it then "executes"
the command it is told by using the #exec cmd phrase, "execute command".
When a page is loaded with a command embedded in it like this it will look for
the CGI file in the path specified in the command line and try and run it. If it
is successful, you will get a print out of either graphics or text displaying
the number of hits to this page, like this:
<img src="http://www.surfari.net/18gif/7.gif">
<img src="http://www.surfari.net/18gif/7.gif">
<img src="http://www.surfari.net/18gif/7.gif">
<img src="http://www.surfari.net/18gif/7.gif">
You see, the hidden code to execute the CGI script just loads HTML images or text to your page, the actual result of the above code will look like this:



The actual "loading" or "executing" of a script from your HTML page is not that difficult. There is only one thing that you must do to this page that is different than other web pages and that is changing it's read, write and execute properties using the UNIX command chmod. We refer to it's uses in another page of this class so we will go over just what you need to set a page that needs to have not only group and user access of readable and executable but also needs to have World permissions as well. This is so the CGI program can write it to the page and the World will be able to see it. The best command and setting for these pages is chmod 755. This will give it almost full priveldges except World writable access. Please refer to the section in this class for a more indepth discussion on chmod