I'm trying to programm a website which is supposed to get a notification/alarm when a file is a added into a DFS folder of a different server. I already tried using weird combinations from ajax and php, which works perfectly fine when applied to the folder the script is in, but when applied to the DFS path it does nothing.
MainPage:
<head>
<link rel="stylesheet" href="style.css"/>
<script src="jquery-2.2.3.min.js" type="text/javascript"></script>
<script>
var filecount = 0;
function tick(){
$.ajax({
type: "GET",
url: "Loader.php",
cache: false
}).done(function( html ) {
if(html>filecount){
alert("NEW FILE!!!!");
}
filecount=html;
});
setTimeout(tick,10000);
}
$(document).ready(function () {
tick();
});
</script>
</head>
Loader.php:
<?php
if ($handle = opendir('\\dent.testsite.net\data\Filetransfer')) {
$counter = 0;
while (false !== ($entry = readdir($handle))) {
if (!is_dir($entry) && $entry != "." && $entry != "..") {
$counter = $counter +1;
}
}
echo $counter;
closedir($handle);
}
?>
Does anybody know that to do?