HTML - contador de visitas

 
Vista:

contador de visitas

Publicado por marianela (1 intervención) el 16/07/2001 18:17:28
Hola, necesito saber como hago funcionar el contador de visita, lo inserte pero no puedo verlo en la pagina.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:contador de visitas

Publicado por Nano (1 intervención) el 16/07/2001 19:12:45
Podrias colocar parte de tu codigo para ver cual es el error.... en todo caso colocar la direccion de tu pagina ( y de paso la promocionas un poco...)
Saludos,
Nano
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:contador de visitas

Publicado por Jujo (3 intervenciones) el 17/07/2001 22:32:00
Si tienes un servidor ASP, en la pagina donde vas aponer el contador por:
<!--#include file="contador.asp"-->

Luego haces un archivo o fichero que se llame contador.asp donde pones esto:
<%
REM This code builds a simple hit counter.
REM You will need to change the path in the CounterFile variable

CounterFile = Server.MapPath ("/cgi-bin/asp") & "jujo.txt"
REM This stores the file name in a variable...it could be any file

Set fs = CreateObject("Scripting.FileSystemObject")
REM use the CreateObject function to create a file object....basically a handle to it.
On Error Resume Next
REM Why is the abbove line here..... i'll come to that ina few lines :)

Set a = fs.OpenTextFile(CounterFile, 1, 0, 0)
c = a.Readline
REM Now the first time this executes the file is not present right so this will
REM return and error message....that's why the earlier On Error Resume Next statement...

set fs = Nothing
c = FormatNumber(c + 1,0)
REM ....FormatNumber Returns an expression formatted as a number.
Set fs = CreateObject("Scripting.FileSystemObject")
set b = fs.CreateTextFile (CounterFile, 1, 0)
REM Create the file again
b.WriteLine c
Set b = Nothing
Response.Write c

REM That's all there is to it
%>

Suerte
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar