Yes. If the script that makes the button on their page is hosted on your server, it may have a .php extension. It therefore would have access to the database or file or whatever you have the stats stored in on your server.
But it would be better to have an ordinary script that creates that script:
also hosted on your server. Let's call this one first.js. So you give them a tag to use like so:
It writes the tag on their page, sending script.php on your server the URL of the page, which it then looks up in the data file and creates the button on their page.