Lo que pasa es que leei que se puede hacer con mysql o txt pero no muestra las visitas en el titulo, entonces solo quiero saber alguna modificacion para hacerlo aparecer en el titulo. vi este:
El php: Código PHP:
<?php
// archivo que guarda el numero de hits
$cont = "cont.txt";
$fp = fopen($cont,rw);
$num = fgets($fp,9999);
fclose($fp);
$fp = fopen($cont,w);
$num += 1;
fputs($fp, $num);
fclose($fp);
?>
El html: Código HTML:
<html>
<head>
<title>Página de Ejemplo</title>
<script language="javascript" TYPE="text/javascript">
<!--
///////////////////////////////////////////////////////////////////
// (C) 2004, Eduardo Gonzalez Gonzalez (www.estadisticasweb.com) //
// Este código y scripts adjuntos son cedidos al dominio público //
///////////////////////////////////////////////////////////////////
var TRACKfrObj;
function TRACKlink(CounterScript) {
if (!document.createElement) { return true };
var TRACKfrDoc;
if (!TRACKfrObj && document.createElement) {
try {
var TRACKfrtemp=document.createElement('iframe');
TRACKfrtemp.setAttribute('id','TRACKframe');
TRACKfrtemp.style.border='0px';
TRACKfrtemp.style.width='0px';
TRACKfrtemp.style.height='0px';
TRACKfrObj = document.body.appendChild(TRACKfrtemp);
if (document.frames) {TRACKfrObj = document.frames['TRACKframe']; }
}
catch(exception) {
TRACKhf='\<iframe id=" TRACKframe" style="';
TRACKhf+='border:0px;';
TRACKhf+='width:0px;';
TRACKhf+='height:0px;';
TRACKhf+='"><\/iframe>';
document.body.innerHTML+= TRACKhf;
TRACKfrObj = new Object();
TRACKfrObj.document = new Object();
TRACKfrObj.document.location = new Object();
TRACKfrObj.document.location.iframe = document.getElementById('TRACKframe');
TRACKfrObj.document.location.replace = function(location)
{ this.iframe.src = location; }
}
}
if (navigator.userAgent.indexOf('Gecko') !=-1 && ! TRACKfrObj.contentDocument)
{setTimeout(' TRACKtrack()',10); return false;}
// Browser tipo/version NS6
if (TRACKfrObj.contentDocument) {TRACKfrDoc = TRACKfrObj.contentDocument;}
// Browser tipo/version IE5.5 & IE6
else if (TRACKfrObj.contentWindow) {TRACKfrDoc = TRACKfrObj.contentWindow.document;}
// Browser tipo/version IE5
else if (TRACKfrObj.document) {TRACKfrDoc = TRACKfrObj.document;}
else { return true; }
TRACKfrDoc.location.replace(CounterScript);
return false;
}
//-->
</script>
</head>
<body bgcolor="#ffffff">
<br><br><br>
Un link de ejemplo:
<span onClick="TRACKlink('contador.php')"><a
href="http://www.estadisticasweb.com" target="_blank">Visite
EstadisticasWeb.com!</a></span>
<br><br><br>
En el archivo "cont.txt" alojado en el servidor se encuentra una cifra
que indica el número de veces que se accedió a este link. <br>
El link contenido en esta página es compatible con los crawlers, y
especialmente con Googlebot. Por lo tanto sirve para transmitir Pagerank.
<br><br><br>
</body>
</html>
Y solo hay quecrear un txt que cuenta las visitas, preferiria crear unas tablas en mysql, y que se vean las visitas en el titulo, gracias.