Here's the algorithm:

if strict_mode is on
    if HTTP_REFERER environment var exists
        check if the REFERER URL is authorized in referer database
            if authorized
                check if the counter needs to be incremented
                    if need to be incremented
                        check if host is in the ignore list
                            if not in the ignore list
                                save referer as key and increment counter
                            endif
                        endif
                    endif
                endif
            endif 
        endif
    else 
        write 8888 and exit or just exit if configured to do so
    endif 
else
    if HTTP_REFERER environment var exists
        check if the counter needs to be incremented
            if need to be incremented
                check if host is in the ignore list
                    if not in the ignore list
                        save (referer as key and increment counter)
                    endif
                endif
            endif
        endif
    else
        check if the counter needs to be incremented
            if need to be incremented
                check if host is in the ignore list
                    if not in the ignore list
                        save (<NO REFERER> as key, increment counter)
                    endif
                endif
            endif
        endif
    endif
endif

Drawback
counter will show different value if the page is accessed differently.
e.g. http:/www.foo.com/index.html 
     http://123.344.122.11/index.html
Hits will differ although they're same site. It can be handled if DNS
lookup is done, but DNS lookup will significantly slowdown the counter, so
I won't add it.


Database support
Count 2.6 supports either of Berkeley db 1.85, GNU gdbm or ndbm databases.
It probes the system in that order too. If you plan to use latest 2.x
Berkeyley db (www.sleepycat.com) you must configure with
--enable-compat185, example:    
    cd build_unix
    ../dist/configure --enable-compat185

to convert referer.ps to gif
convert  -density 300 -geometry 29% referer.ps referer.gif
