Contatore




<!-- C O N T A T O R E 17 marzo 2020 -->

<table align="center" width="100%">
<tr>

<td align="center" bgcolor="#FFFFFF" width="90%"><strong>Contatore Visite </strong> 


<%
if session("autenticato") = "" then

dim Totale
filePath = Server.Mappath("file_testo.txt")

Set objFileSystem = Server.CreateObject("Scripting.FileSystemObject")
if objFileSystem.FileExists(filePath ) then
Set objFile = objFileSystem.OpenTextFile(filePath, 1)
'leggo file riga per riga fino alla fine del file
Do While Not objFile.AtEndofStream
totale = objFile.ReadLine +1
Loop
objFile.Close
Set objFile=Nothing
end if



if not objFileSystem.FileExists(filePath) then
'se non esiste lo creo
objFileSystem.CreateTextFile(filePath)

end if

Set objFile = objFileSystem.OpenTextFile(filePath, 2)
'scrivo una riga sul file

' objFileSystem.OpenTextFile(filePath, 2) -> sovrascrivo file
' objFileSystem.OpenTextFile(filePath, 8) -> aggiungo il testo al fondo del file
objFile.WriteLine(totale)
objFile.Close
Set objFile=Nothing
Set objFileSystem=Nothing


Session("Contatore") = totale

Stringa = "<img border=0 src='" & Mpath & "immagini/b00testa.jpg' width=5 height=25>"

for c = 1 to (cint(6) - len(Session("Contatore")))
Stringa = Stringa & "<img border=0 src='" & Mpath & "immagini/b0.jpg' width=25 height=25>"
next


for c = 1 to len(Session("Contatore"))
if mid(Session("Contatore"),c,1) = "0" then
Stringa = Stringa & "<img border=0 src='" & Mpath & "immagini/b0.jpg' width=25 height=25>"
elseif mid(Session("Contatore"),c,1) = "1" then
Stringa = Stringa & "<img border=0 src='" & Mpath & "immagini/b1.jpg' width=25 height=25>"
elseif mid(Session("Contatore"),c,1) = "2" then
Stringa = Stringa & "<img border=0 src='" & Mpath & "immagini/b2.jpg' width=25 height=25>"
elseif mid(Session("Contatore"),c,1) = "3" then
Stringa = Stringa & "<img border=0 src='" & Mpath & "immagini/b3.jpg' width=25 height=25>"
elseif mid(Session("Contatore"),c,1) = "4" then
Stringa = Stringa & "<img border=0 src='" & Mpath & "immagini/b4.jpg' width=25 height=25>"
elseif mid(Session("Contatore"),c,1) = "5" then
Stringa = Stringa & "<img border=0 src='" & Mpath & "immagini/b5.jpg' width=25 height=25>"
elseif mid(Session("Contatore"),c,1) = "6" then
Stringa = Stringa & "<img border=0 src='" & Mpath & "immagini/b6.jpg' width=25 height=25>"
elseif mid(Session("Contatore"),c,1) = "7" then
Stringa = Stringa & "<img border=0 src='" & Mpath & "immagini/b7.jpg' width=25 height=25>"
elseif mid(Session("Contatore"),c,1) = "8" then
Stringa = Stringa & "<img border=0 src='" & Mpath & "immagini/b8.jpg' width=25 height=25>"
elseif mid(Session("Contatore"),c,1) = "9" then
Stringa = Stringa & "<img border=0 src='" & Mpath & "immagini/b9.jpg' width=25 height=25>"
end if
next

Stringa = Stringa & "<img border=0 src='" & Mpath & "immagini/b9fine.jpg' width=5 height=25>"


Response.Write stringa
session("autenticato") = stringa

else

Response.Write session("autenticato")

end if


%>




</table>

<!-- E N D C O N T A T O R E 17 marzo 2020 -->










( contatore.html )- by Paolo Puglisi - Modifica del 17/12/2023