-1

Some website article pictures often be deleted. I want a tool can watch which php files have been executed within a period of time.

The envirment is apache+mysql on windows server2008 R2

AustinWBryan
  • 3,249
  • 3
  • 24
  • 42
frontGirl
  • 33
  • 8

1 Answers1

0

use this to get the file name:

 $fname=   $_SERVER["SCRIPT_FILENAME"];

or

$fname=  basename(__FILE__, '.php'); //without extension

and use this to log it to a file :

$logfile = fopen("log.txt", "w") or die("Unable to open file!");
$txt = $fname;
fwrite($logfile, $txt);
$ts=time();
fwrite($logfile, $ts);
fclose($logfile);

you can wrap it in a function and call it in the beginning of each php file.

USER249
  • 1,080
  • 7
  • 14