js| counter
<!--
Jsp-hitcounter counts sessions.
Copyright (C) Jesper Schmitz Mouridsen.
Visit Www.webappcabaret/jsm2/webapps.jsp?find=jsphcs for more info.
This are free software; Can redistribute it and/or modify it under the terms of the GNU general public License as published by the free Softwa Re Foundation; Either version 2 of the License, or (at your option) any later version.
This are distributed in the hope that it'll be useful and but without any WARRANTY; Without even the implied warranty of merchantability or FITNESS for A particular purpose. License at http://www.opensource.org/licenses/gpl-license.html for more details
-->
<%
BufferedReader inf = new BufferedReader (New FileReader ("/path/to/counter.txt"));
int tmp = Integer.parseint (Inf.readline ());
int i=0;
try {
i = Integer.parseint (Request.getsession (). GetValue ("Tal"). ToString ());
catch (NullPointerException t) {i=0}
if (i==0) {
tmp++;
PrintWriter Outf = new PrintWriter (New BufferedWriter ("FileWriter"));
OUTF.PRINTLN (TMP);
Outf.close ();
Inf.close ();
Request.getsession (). Putvalue ("Tal", "1");
}
BufferedReader inf2 = new BufferedReader (New FileReader ("/path/to/counter.txt"));
%>
<%
String zeroes= "";
String hits = Inf2.readline ();
Inf2.close ();
for (int t=0 T < 8-hits.length (); t++) {
zeroes=zeroes+ "0"; }
OUT.PRINTLN (zeroes + hits);
%>