Dopo dura riflessione, Antico ha scritto :
>> Dicendo refresh intendi una cosa così?
>> <META HTTP-EQUIV="refresh" CONTENT="15">
>
> Con il refresh degli headers in php...
Ok, prova questo.
Però vale come esercitazione perché è veramente troppo snello.
--- index.php
<html>
<head>
<title>Prova download di file</title>
<script type="text/javascript">
function Countp(){
var xhr = new XMLHttpRequest;
xhr.onreadystatechange=function(){
if(xhr.readyState==4 && xhr.status==200){
var co = document.getElementById('dwl');
co.innerText = xhr.responseText;
}
};
xhr.open("GET", '/contaclick/Countp.php');
xhr.send();
}
</script>
</head>
<body>
<div align="center">
<p> </p>
<a href="getfile.php?&name=prova" onclick="Countp()">Scarica
Prova.zip</a> (download <span id="dwl"> <?php
@include("count/prova.txt"); ?></span>, size <?php
$dim = @filesize ("prova.zip") / 1024;
$dim = round($dim);
echo $dim . 'KB';
?>)
<p> </p>
<p> </p>
<b><a href="
http://www.spacemarc.it" target="_blank">Script scaricato
da Spacemarc.it</a></b>
</div>
</body>
</html>
aggiungi un file
-- /contaclick/Countp.php
<?php
$a = file_get_contents('count/prova.txt');
echo $a + 1;
exit();
---
In pratica viene aggiunta una funzione javascript e un file .php
Bye!