0

Possible Duplicate:
How can I get the client's IP address in a PHP webservice?

I've a small site that lets anonymous users to upload images. However, this obviously has the potential to be abused. How could I track/log relevant information (IP address etc) for each image that is uploaded? I'm using PHP and MySQL.

Thanks.

Community
  • 1
  • 1
oxo
  • 4,343
  • 10
  • 32
  • 35
  • 2
    What part of doing this is your question about - serving the image, writing data into a database...? – Pekka Sep 30 '11 at 08:57

2 Answers2

1

to getting the IP address of the user who upload the image, you just add the $_SERVER['REMOTE_ADDR'] to the image upload script, and you will get the IP address of the user.

jogesh_pi
  • 9,762
  • 4
  • 37
  • 65
0

$_SERVER

'REMOTE_ADDR' The IP address from which the user is viewing the current page.

$_SERVER['REMOTE_ADDR'];

You can find how to get relevant data for each user.

http://php.net/manual/en/reserved.variables.server.php

Mob
  • 10,958
  • 6
  • 41
  • 58