HOME | GETTING STARTED | WEB HOSTING | DOMAINS | MY ACCOUNT | SUPPORT | ABOUT
       Home: Support: Manual: CGI: Count index.cgi:

"index.cgi" HTML Page Counter

After activating index.cgi as explained in the previous section, create a file named ".count" with one line that contains the number 0. Then type chmod o+w .count in telnet to allow the counter to be updated. The counter and index.cgi are in your main page in this example.

When http://your-domain.com is referenced at the browser, instead of delivering the file "index.html" as normally expected, the program "index.cgi" is run instead. "index.cgi" reads the ".count" file, increments the number in that file by one, and writes the file back on disk. Then it reads in the "index.html" file, finds the string "#COUNT" imbedded somewhere in it, changes "#COUNT" to 1 + whatever value if found in ".count", and sends the modified "index.html" to the browser.


COPYRIGHT © 2001-2002 ATLAS-HOST.COM