I haven't written a visitor log script myself, but i have been doing some similar things with logging other stuff and using SSI, (although on NT),.....AND it's just a thought, but check your server is configured to run SSI 'exec' commands, as there have been issues with security on some web servers.