Okay so I'm looking into using the fwrite() function to log IP addresses when a user uploads an image on my site. So basically, my question is... can fwrite() write to files with a password protected directory or is more coding required for this?
If the directory is protected via htaccess then yes you can use fwrite to write files in those directories.