begin process at 2012 05 27 16:57:41
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

Divers

 > BON LOG (PRET A EMPORTER!!!)

BON LOG (PRET A EMPORTER!!!)


 Information sur la source

Note :
6,67 / 10 - par 3 personnes
6,67 / 10

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10
Catégorie :Divers Niveau :Débutant Date de création :17/05/2003 Date de mise à jour :17/05/2003 21:27:02 Vu :2 456

Auteur : GuilleW

Ecrire un message privé
Commentaire sur cette source (2)
Ajouter un commentaire et/ou une note

 Description

Copier sa dans votre index " En PHP !! "


Source

  • <?php
  • if ($NomFichierLog == '') { $NomFichierLog = 'Visite/Log - ' ; }
  • $tdate=getdate();
  • $quand = sprintf("%02.2d",$tdate["mon"]);
  • if ($quand == '01') { $quand = 'Janvier' ; }
  • if ($quand == '02') { $quand = 'Fevrier' ; }
  • if ($quand == '03') { $quand = 'Mars' ; }
  • if ($quand == '04') { $quand = 'Avril' ; }
  • if ($quand == '05') { $quand = 'Mai' ; }
  • if ($quand == '06') { $quand = 'Juin' ; }
  • if ($quand == '07') { $quand = 'Juillet' ; }
  • if ($quand == '08') { $quand = 'Aout' ; }
  • if ($quand == '09') { $quand = 'Septembre' ; }
  • if ($quand == '10') { $quand = 'Octobre' ; }
  • if ($quand == '11') { $quand = 'Novembre' ; }
  • if ($quand == '12') { $quand = 'Decembre' ; }
  • $quand = $quand . " " . $tdate["year"] ;
  • $NomFichierLog = $NomFichierLog . $quand . " - .txt";
  • $ip = $REMOTE_ADDR;
  • $hostname = gethostbyaddr($REMOTE_ADDR);
  • if ($hostname == $ip) {
  • $ipsay = $ip; }
  • else {
  • $ipsay = $hostname ." [". $ip ."]"; }
  • if ($HTTP_REFERER != '') {
  • $ipsay = $ipsay . " - Lien: " . $HTTP_REFERER;
  • }
  • $fichier2 = fopen($NomFichierLog, "a");
  • $jour=sprintf("%02.2d",$tdate["mday"]) ."/". sprintf("%02.2d",$tdate["mon"]) ."/". $tdate["year"];
  • $heure=sprintf("%02.2d",$tdate["hours"]) ."h". sprintf("%02.2d",$tdate["minutes"]);
  • $d="[".$jour." à ".$heure."] ";
  • fwrite($fichier2,$d.$ipsay."
  • ");
  • fclose($fichier2);
  • ?>
<?php
if ($NomFichierLog == '') { $NomFichierLog = 'Visite/Log - ' ; }
$tdate=getdate();
$quand = sprintf("%02.2d",$tdate["mon"]);
if ($quand == '01') { $quand = 'Janvier' ; }
if ($quand == '02') { $quand = 'Fevrier' ; }
if ($quand == '03') { $quand = 'Mars' ; }
if ($quand == '04') { $quand = 'Avril' ; }
if ($quand == '05') { $quand = 'Mai' ; }
if ($quand == '06') { $quand = 'Juin' ; }
if ($quand == '07') { $quand = 'Juillet' ; }
if ($quand == '08') { $quand = 'Aout' ; }
if ($quand == '09') { $quand = 'Septembre' ; }
if ($quand == '10') { $quand = 'Octobre' ; }
if ($quand == '11') { $quand = 'Novembre' ; }
if ($quand == '12') { $quand = 'Decembre' ; }
$quand = $quand . " " . $tdate["year"] ;
$NomFichierLog =  $NomFichierLog .  $quand . " - .txt";

$ip = $REMOTE_ADDR;
        $hostname = gethostbyaddr($REMOTE_ADDR);
if ($hostname == $ip) {
$ipsay = $ip; }
else {
$ipsay = $hostname ." [". $ip ."]"; } 


if ($HTTP_REFERER != '') {
$ipsay = $ipsay . " - Lien: " . $HTTP_REFERER; 
}

$fichier2 = fopen($NomFichierLog, "a");
     

     $jour=sprintf("%02.2d",$tdate["mday"]) ."/". sprintf("%02.2d",$tdate["mon"]) ."/". $tdate["year"];
     $heure=sprintf("%02.2d",$tdate["hours"]) ."h". sprintf("%02.2d",$tdate["minutes"]);
     $d="[".$jour." à ".$heure."] ";
fwrite($fichier2,$d.$ipsay."
");
fclose($fichier2);
?>

 Conclusion

Sa créé un fichier avec comme nom le mois en cours .. et puis vous n'avez qu'a le tester pour voir !!!!

:)



 Sources du même auteur

Source avec Zip Source avec une capture LIVRE D'OR |PHP SEULEMENT| BON LOOK+SMIL&AMP;#201; :)

 Sources de la même categorie

Source avec une capture MODULE JOOMLA 1.5 NOW LISTENING par Alcantornet
Source avec Zip Source avec une capture UPLOAD CENTER par basssem81
Source avec Zip COMPTEUR DE CLIQUE PHP AVEC JQUERY par devgoneti
Source avec Zip LIVRE D'OR SIMPLE (POUR DÉBUTANT) par devgoneti
Source avec Zip SCRIPT TRAVAUX POUR VOTRE SITE par FleuryK

Commentaires et avis

Commentaire de oOoJasonoOo le 18/05/2003 10:41:52

mouais ... clasique mais COOL ;o)) continue man c exellent

Commentaire de revinc le 19/05/2003 13:06:44

pas mal mais à la place de ton if(truc= numero) alors (bidule = "mois") 12 fois fais un tableau ça fera douze fois moins crade!
$mois = Array("janvier", ..., "décembre");

$quand = $mois[$quand/1];

bon 7/10 quand même

++

 Ajouter un commentaire




Nos sponsors


Sondage...

CalendriCode

Mai 2012
LMMJVSD
 123456
78910111213
14151617181920
21222324252627
28293031   

Consulter la suite du CalendriCode

A découvrir



 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 0,624 sec (4)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales