I would strongly advice agains sending the entire web-page from the Arduino each time the counters are updated. I would recommend you to use the Arduino to serve the counters as a JSON-object which can be polled with JavaScript / AJAX and updated without reloading the entire page every time.
But.. I think your problem is that in HTML, the place where to put the counter is where "XFF" is found. XFF is ASCII text worth 3 characters. "file.read()" returns one byte / character which you test for being "0xFF" - this cannot work.
Try to replace "XFF " with "$" in the HTML and "if ((c==0xff)&&(flghtm==1))" with "if ((c=='$')&&(flghtm==1))" in the sketch and see what happens ![]()