1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
| <html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#003366" text="#FFFFFF" link="#FFCC00" vlink="#FFCC33" alink="#FFCC33">
<table width="100%" border="0" height="70">
<tbody>
<tr>
<td align="center">
<?php
//faut verifier le nombre de clics necessaires pour la pub
$nbpage = 2;
?>
<form name="compteur">
<input name="nbclic" value="<?php echo($_POST['nbclic']); ?>" size="1" readonly="readonly" type="hidden">
<font face="Verdana" size="2"><strong>Vous avez visité <span id="nbc"><?php echo($_POST['nbclic']); ?></span>
page(s)/
<?php echo($nbpage); ?> sur ce site.</strong></font>
<input name="nbpage" value="2" type="hidden">
<input name="ok" value="false" type="hidden">
<input name="initcompteurbonus" value="0" type="hidden">
</form>
<?php
if ($_POST['nbclic'] < $nbpage) {
?>
</td>
</tr>
</tbody>
</table>
<script language="JavaScript">
function timer()
{
setTimeout("calcul()",1000);
}
function calcul()
{
document.compteur.nbclic.value = parent.history.length-(document.compteur.initcompteurbonus.value);
document.getElementById('nbc').innerHTML=document.compteur.nbclic.value;
if (parseInt(document.compteur.nbclic.value) >= parseInt(document.compteur.nbpage.value))
{
document.compteur.ok.value = "true";
document.compteur.method = "POST";
document.compteur.action = "nbclic.php";
document.compteur.submit();
}
else
{
timer()
}
}
timer();
document.compteur.initcompteurbonus.value = window.parent.history.length;
</script>
</body>
</html>
<?php
}
else {
//on fait l'action de fin de procedure
?>
</td>
</tr>
</tbody>
</table>
</body>
</html>
<?php
}
?> |
Partager