Page 1 of 1

Help with log ip address when download

Posted: Mon May 08, 2006 11:23 am
by SuperX
I need help to create PHP code for my download page... when a user download the file and when they try to download again, they have to wait for like 10 minutes or so. I need help with IP address log, stuff like that. Thanks! :D

Posted: Mon May 08, 2006 11:43 am
by Chris Corbyn
Just store $_SERVER['REMOTE_ADDR'] in a database along with time() and make sure the time they download the file is more than 600 seconds since the record in the database, or there's no record in the database for that IP.

Note: $_SERVER['REMOTE_ADDR'] might be a public proxy server, in which case you *might* be lucky to find the real IP by checking $_SERVER['X_FORWARDED_FOR']. Essentially, anything that's restricting IP's is not particularly reliable.