计算唯一访问者并将其发送到mysql数据库

I'd like to know how can i get information about uniques IP's to my site specify link and store that information in mysql database to particular user. I need that script count not only http://example.com.com but also ex.: http://example.com/somesub/this/link. Because i want to develop project in which users get traffic to my system and they get paid. (Pay to Promote system). How can i develop this? Any ideas about php code?

First of all use $_SERVER['REMOTE_ADDR'] to find the request IP Address or see How to get client IP address PHP. then at the start of each page of your site you should get this value (which acts like a primary key) and do query to the database to increase the specific counter.

P.S: you will find problems in case the client is using proxy to get to your site, see the link above for more information.