save a logs to txt file

I have the code from the dhtmlx. And I want that when I click on “Add file”

  vault.strings.btnAdd = "Add file";

also automatically appear write to a txt file with a date who added the file. I have no idea how to go about it.

<div id="vaultDiv"></div> 
   vault=new dhtmlXVaultObject(); 
   vault.strings.btnAdd = "Add file";
   vault.strings.btnUpload = "Upload";
   vault.strings.btnClean = "Clean";
   vault.strings.errors["TooBig"] = "File is too big ({0} bytes).\nMax allowed size is {1}.";
   vault.strings.errors["PostSize"] = "Undefined server error. Possible issues:\n"+
        "- Unicode file name incorrectly processed by the server;\n"+
        "- File size is bigger than server's post-request limit ({0}).";

Do you have the information (a date who added the file) on server?

I know how to do this in php. But I have no idea how to do it in dhtmlx.

Do what? Please tell us more. I do not understand your question.

Ok i made in php

  $d = date('Y-m-d H:i:s')." Log on: " .$user ." \r\n";
    $file = "log.txt";
    $fp = fopen($file, "a");
    flock($fp, 2);
    fwrite($fp, $d);
    flock($fp, 3);

This code writes to a txt file when and who logged on. I want to do that when someone adds a file (from the computer), it also writes a note in a txt file. I do not know so well dhtmlx so please help.

You should simply add this your code to the end of file “UploadHandler.php”