Will bots follow an image with a link and thus activate my php download script? I guess they will...
a link is a link is a link.
All they see and care about if that you have an "A HREF" tag, they don't know or particularly care that it contains an image.
The whole point of those bots is that they eventually crawl the entire internet, discovering new sites by following links from other places and the likes. It doesn't know what's behind a link until it follows it, after all.
You can prevent that behaviour by using the 'nofollow' tag, which keeps the bots from following the links on your page.
for more info on how to do that, see:
http://www.robotstxt.orgYou could just put the nofollow on any of your pages that contain the shopping links, but leave the others open to be indexed. Another way is to explicitely disallow certain files to be indexed through the robots.txt file. Unfortunately not all bots recognize and honor those restrictions, but the 'big' ones do and those probably account for the majority of the bot-realted hits anyway.
Now, keep in mind: while it may be an inconvenience to have the bots index parts of your site, in general the bots are a GOOD thing since they increase your exposure, and search engine ratings. The more of your pages are indexed and listed in a search engine, the bigger the chance that one of them will be a match for whatever people are searching for.
Another thought: since you have a PHP page that does the actual counting, you could even implement a 'smarter' counter by not incrementing your counters if the user-agent of the visitor indicates a bot...
(Pretty much all bots identify themself that way, e.g. 'googlebot')
either you can only count hits from 'recognized' browsers like Netscape, Internet Explorer, firefox, Opera, safari and the likes, or you can find a list of common bots and specifically tell your PHP page to exclude those from the counter.
alternatively, you could add some PHP code to count each specific user-agent type, and that way you know exactly what browser your visitors are using, AND which bots have seen crawled your site.