I’m no PHP guru… so far I’ve just done some PHP mail forms. All I want to do this time is write to a server side log, telling me whenever someone has “clicked” a link to download/view a PDF file. I don’t need to go the whole 9 yards of trying to track the origin of the person downloading, or whether its a robot or a human, or even whether the download completes. a simple timestamp will do. I short, I don’t expect any more accuracy then your typical visitor counter. Maybe PHP isn’t the easiest way to go here?
I guess it would be nice if I could simply sue the onclick() event in my <a href…> download link. But then that gets back to the (usually) ugly matter of trying to to get javascript and PHP to work together and share variables. I wonder if I’ll have to repeat that ugliness or if there will be a simpler way.
I’m aware that Google Analytics and some other companies offer a service to help with this problem. But I always learn more when the solution is code I can see and tweak, and doesn’t depend on a “free” service, that often becomes a “paid” service once they get you “hooked” π