'; echo ''; echo ''; break; case 'ad': // header('Refresh: 0; url='.$myTargetUrl); break; } } ?> character_set_name(); $mysqli->query("set names 'utf8';"); printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } if (!$mysqli->set_charset("utf8")) { printf("Erreur lors du chargement du jeu de caractères utf8 : %s\n", $mysqli->error); } */ $ctToUse=0; if(isset($_GET['ct']) && $_GET['ct']) { $ctToUse=$_GET['ct']; } if(isset($_GET['type'])) { switch($_GET['type']) { case 'epub': case 'pdf': $sql_log = "INSERT INTO `ilivri`.`traffic_dl_stats` (`dls_id`, `ct_id`,`book_id`, `file_type`, `host`, `user_agent`, `timestamp`) VALUES (NULL,".$ctToUse.", '".$_GET['id']."', '".$_GET['type']."', '".$_SERVER['HTTP_HOST']."', '". $_SERVER['HTTP_USER_AGENT']."', NOW())"; break; case 'ad': $idToUse="NULL"; if($_GET['id']) { $idToUse="'".$_GET['id']."'"; } $typeFrom="NULL"; if($_GET['typeFrom']) { $typeFrom="'".$_GET['typeFrom']."'"; } $sql_log = "INSERT INTO `ilivri`.`traffic_ad_stats` (`ads_id`, `ct_id`, `book_id`, `type_from`, `ad_url`, `host`, `user_agent`, `timestamp`) VALUES (NULL, ".$ctToUse.",".$idToUse.",".$typeFrom.", '".$_GET['url']."', '".$_SERVER['HTTP_HOST']."', '". $_SERVER['HTTP_USER_AGENT']."', NOW())"; break; } // echo $sql_author; /* if (!$rs2 = $mysqli->query($sql_log)) { echo "
statistic failed ($sql_log)"; //print_r($_GET,true) } */ switch($_GET['type']) { case 'ad': header("Location: ".$_GET['url'],TRUE,303); break; } } } ?>
casden