bdd_connecter_base("OBERLECHNER.NET"); $base->bdd_execsql("SELECT COUNT(*) FROM livredor"); $cptannot = $base->bdd_lire_champ(1); $base->bdd_execsql("SELECT SUM(du_cpt) FROM download_url"); $cptdownload= $base->bdd_lire_champ(1); $base->bdd_param_init("parameters","param_clef","param_valeur"); $cptpage = $base->bdd_param_load("ACCUEIL_CPT"); // ON INCREMENTE LE COMPTEUR QUE SI L'ADRESSE IP DU CLIENT EST DIFFERENTE DE CELLE SAUVEGARDEE // ON EVITE AINSI D'AJOUTER +1 SI SIMPLE RAFFRAICHISSEMENT DE LA PAGE $derniereIP = $base->bdd_param_load("ACCUEIL_IP"); $nbjours_avant_purge = $base->bdd_param_load("DOWNLOAD_PURGEHISTO"); if ($_SERVER["REMOTE_ADDR"]!=$derniereIP) { $cptpage++; $base->bdd_param_rec("ACCUEIL_CPT",$cptpage); $base->bdd_param_rec("ACCUEIL_IP",$_SERVER["REMOTE_ADDR"]); // TESTER SI AUJOURD'HUI A ETE MEMORISE $base->bdd_execsql("SELECT COUNT(*) FROM download_histo WHERE dh_date='".$base->bdd_date_courante()."'"); $cpthistodujour = $base->bdd_lire_champ(1); // SI NON ALORS ON SAUVEGARDE LES CPT VISITE ET DOWNLOAD if ($cpthistodujour==0) { $requete = "INSERT INTO download_histo (dh_date,dh_type,dh_cpt) VALUES ('".$base->bdd_date_courante()."','V',".$cptpage.")"; $base->bdd_execsql( $requete ); $requete = "INSERT INTO download_histo (dh_date,dh_type,dh_cpt) VALUES ('".$base->bdd_date_courante()."','D',".$cptdownload.")"; $base->bdd_execsql( $requete ); } } ?> Site de Franck Oberlechner dédié à la programmation PHP et PERL