$var) {$$key = $var;} foreach($_GET as $key => $var) {$$key = $var;} //echo "=>".$key, $$key, $var; ?> réessayer ultérieurement... "); @mysql_query("SET NAMES 'utf8'"); // permet des gerer les accents pour les insertions dans la base if ($REMOTEADDR=='') $REMOTEADDR=$_SERVER["REMOTE_ADDR"]; if ($REMOTEADDR=='') $REMOTEADDR=$REMOTE_ADDR; if ($REMOTEHOST=='') $REMOTEHOST= @gethostbyaddr( $REMOTE_ADDR ); if ($REMOTEHOST=='') $REMOTEHOST=$REMOTE_HOST; $REMOTEHOST=@gethostbyaddr( $_SERVER["REMOTE_ADDR"] ); if ($HTTPUSERAGENT=='') $HTTPUSERAGENT=$_SERVER["HTTP_USER_AGENT"]; if ($HTTPUSERAGENT=='') $HTTPUSERAGENT=$HTTP_USER_AGENT; if ($HTTPREFERER=='') $HTTPREFERER=$httpreferer; if ($HTTPREFERER=='') $HTTPREFERER=$_SERVER["HTTP_REFERER"]; if ($HTTPREFERER=='') $HTTPREFERER=$HTTP_REFERER; //echo "referer = $HTTP_REFERER"; //if ($HTTP_REFERER == "") {echo ""; die ("Statistique SRDEV - visitez le site général accueil");} $datej = date("d/m/Y"); $heurej = date("H:i"); $VAD_nom = $_COOKIE["VAD_nom"]; if ($dstat=='') $dstat= $societe; // nouvelle variable pour PAGE car untilisé par google image if ($page_stat!="") $page= $page_stat; if ($page!="") $visite_page = $page; //if (substr($visite_texte,0, strlen($password_maintenance)) == $password_maintenance || $password_maintenance != "") // $visite_texte ="saisie du mot de passe maintenance"; if ($visite_texte == "madripoor") $visite_texte ="saisie du mot de passe maintenance MA..."; // enregistrement de la visite dans la table $SQL = "INSERT INTO session (id, jour, datej, heurej, SITE, PAGE, REMOTE_ADDR, REMOTE_HOST, HTTP_USER_AGENT, HTTP_REFERER, etat, nom, texte, compteur) VALUES ('".$id."','".date("Y-m-d H:i:s")."','".($datej)."','$heurej','$dstat','$visite_page','$REMOTEADDR','".quote1($REMOTEHOST)."','$HTTPUSERAGENT','$HTTPREFERER','','$VAD_nom','".quote1(trespaceOTE1(stripcslashes(utf8_encode($visite_texte))))."','1')"; $result = mysql($database,$SQL); echo "Retour = $result)
Site : $dstat
Texte : " . stripcslashes(utf8_encode($visite_texte)) . "
REMOTEHOST : $REMOTEHOST
HTTPUSERAGENT : $HTTPUSERAGENT
HTTPREFERER : $HTTPREFERER

$SQL $result
"; /* echo "INSERT INTO session (id, datej, heurej, SITE, PAGE, REMOTE_ADDR, REMOTE_HOST, HTTP_USER_AGENT, HTTP_REFERER, etat, nom, texte, compteur) VALUES ('".session_id()."','$datej','$heurej','$dstat','$page','$REMOTEADDR','".quote1($REMOTEHOST)."','$HTTPUSERAGENT','$HTTPREFERER','','$VAD_nom','".quote1(trespaceOTE1($visite_texte))."','1')"; echo "result=".$result; */ function trespaceOTE1($cha) { //$cha = ereg_replace("|", "
", $cha); $cha = ereg_replace("ÿ", "&", $cha); $cha = ereg_replace("ÿ", "&", $cha); //$cha = ereg_replace("&", "%26", $cha); //$cha = ereg_replace("=", "%3D", $cha); return $cha; } function quote1($chaine) { $chaine = ereg_replace("'","''",$chaine);return ereg_replace("´","''",$chaine) ; } function datefr($date_modif, $heurea="") // Entre=2000-12-30 sort=30/12/2000 { //echo $date_modif.$heurea; $date_modif_retour = $date_modif; if ($date_modif_retour== "") return ""; // si un tiret alors c'est pas un format americain donc pas de formatage //if (ereg("-", $date_modif_retour)) return $date_modif_retour; if (ereg("-", $date_modif)) $date_modif_retour = substr($date_modif,8,2)."/".substr($date_modif,5,2)."/".substr($date_modif,0,4); if ($heurea=="") if (ereg(":", $date_modif)) $date_modif_retour = $date_modif_retour." ".substr($date_modif,11,2).":".substr($date_modif,14,2); //echo $date_modif_retour; //if (! is_date( $date_modif ) ) $date_modif = ""; if (ereg("//", $date_modif_retour)) $date_modif_retour = ""; //if ($date_modif_retour= "") echo "date_modif_retour=$date_modif_retour"; return substr($date_modif_retour,0,16); } function dateus($date_modif, $heurea="") // Entre=30/12/2000 sort=2000-12-30 { $date_modif_retour = $date_modif; if (ereg("/", $date_modif)) { $date_modif_retour = substr($date_modif,6,4)."-".substr($date_modif,3,2)."-".substr($date_modif,0,2); if ($heurea=="") if (ereg(":", $date_modif)) $date_modif_retour .= " ".substr($date_modif,11,2).":".substr($date_modif,14,2); } //echo $date_modif, $date_modif_retour; return $date_modif_retour; } ?>