How can i track hot linkers ip address using php

.htaccess, php

Solution

You could create an intercept PHP script which would be responsible for handling all requests for images which are stored in a specific folder. Lets say all your images are located inside the `images/` folder. You would simply need to create a rewrite rule which will redirect all requests for files inside that folder to a PHP script.

RewriteRule images/(.+)\.(jpg|gif|png) images.php?image=$1.$2

This way you would still retain the ability to use your images inside markup the way you did before.

<img src="images/logo.png" />

Do take into consideration that this approach might have a heavy impact on your system performance because all requests for image resources are now creating processing overhead due to the fact that PHP is invoked every time.

Problem

have a picture in my server named /images/pic.jpg . I want to track ip address of users who try to access that pic directly through url lik www.domain.com/images/pic.jpg. I can track ip address of manual user by: ``` <?php $ipAddress = $_SERVER['REMOTE_ADDR']; ?> ```

Original source