This code snippet actually contains a few nifty things. There are two functions, hasVisited() and main(). hasVisited() makes use of a very handy function for CGI programmers: getenv. You can see I use it to retrieve REMOTE_ADDR which is the person's IP address. In main() it gets the count from a file and increments if needed and outputs back to the same file. It then outputs a simple HTML page that the user sees.