• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

logging IP address

nodoubts2k

Golden Member
I have a section of my website that allows users to upload files. I would like to have the persons IP logged when they upload a file, as well as the name of the file that they upload.

The upload script is very simple,


Any help would be greatly appreicated.

Also, I dont really know much about mysql or anything. For the logging it could even be in notepad or something.
 
If you're dealing with text files you want to be pretty careful. In a multi-threaded environment just opening up common text files isn't a great idea. (Granted file upload doesn't happen all that often so you're probably safe). A better solution might be writing logs to your database (if you have one) or checking out the openlog and syslog functions. Of course those would require some configuration to get them to work properly, I don't know how easy or manageable that would be.
 
Originally posted by: kamper
If you're dealing with text files you want to be pretty careful. In a multi-threaded environment just opening up common text files isn't a great idea. (Granted file upload doesn't happen all that often so you're probably safe). A better solution might be writing logs to your database (if you have one) or checking out the openlog and syslog functions. Of course those would require some configuration to get them to work properly, I don't know how easy or manageable that would be.

Teh Winnar! Store them in a mysql database instead.
 
Originally posted by: Modeps
Originally posted by: kamper
If you're dealing with text files you want to be pretty careful. In a multi-threaded environment just opening up common text files isn't a great idea. (Granted file upload doesn't happen all that often so you're probably safe). A better solution might be writing logs to your database (if you have one) or checking out the openlog and syslog functions. Of course those would require some configuration to get them to work properly, I don't know how easy or manageable that would be.

Teh Winnar! Store them in a mysql database instead.

I know absolutely nothing about mysql. Is there somewhere that tells me how to do this?
 
Originally posted by: amdfanboy
Simple text file logging

I get the error "Parse error: parse error, unexpected T_STRING in /homepages/32/d88496332/htdocs/files/upload.php on line 10". I modified the original code so it writes in the main directory,
 
Back
Top