0
I have a watermark code on every image that was uploaded. At the end of this code, I would like every time a person uploads the image, to create a record in a notepad. I arrived at this code but I’m having a hard time getting it to keep track of multiple uploads.
$arquivo = "rastro.txt";
$data = date("d/m/Y H:i:s");
$ip = $_SERVER['REMOTE_ADDR'];
$browser = $_SERVER['HTTP_USER_AGENT'];
$fp = fopen($arquivo, "w+");
fwrite($fp,"Nome: $new_name | Data: $data | IP: $ip | Navegador: $browser");
fclose($fp);
How do I generate a loop in code ?
The loop would be after opening the file
fopen
, the$new_name
you pick from where?– Jhonatan Simões
From the code that creates the watermarks. It’s just this part where I was in doubt, but $new_name is working normal
– André
Yes I have no doubt about it, but when you get the
$new_name
it is likely that you take from an array not?– Jhonatan Simões
In this particular case, no :)
– André
Well, I believe that in order to help you I need more information, because your code is correct... more precise information of your scope, of the variables that you have there.
– Jhonatan Simões
Well, I’m still learning and so don’t notice the kkk mangrove, but follow the whole code here: http://pastebin.com/5H6MTabs
– André
I posted an answer, test it and see if it works.
– Jhonatan Simões