Skip to content

Instantly share code, notes, and snippets.

@mickael-kerjean
Last active January 11, 2024 11:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mickael-kerjean/289d3d0be8fab2f90e2ff541bc3415a6 to your computer and use it in GitHub Desktop.
Save mickael-kerjean/289d3d0be8fab2f90e2ff541bc3415a6 to your computer and use it in GitHub Desktop.
<?php
require_once "../../functions/lib_tracker.php";
require_once "../../functions/lib_mysql.php";
$payload = json_encode(Array(
"ip" => get_client_ip(),
"url" => $_SERVER["HTTP_REFERER"],
"ua" => $_SERVER["HTTP_USER_AGENT"],
"lang" => $_SERVER['HTTP_ACCEPT_LANGUAGE'],
"session" => $_COOKIE["webid"],
"referrer" => $_COOKIE["referral"],
));
db_execute(
"INSERT INTO event(type, payload) VALUES(?, ?)",
["filestash_website_visit", $payload]
);
header("Cache-Control: no-cache, must-revalidate"); //HTTP 1.1
header("Pragma: no-cache"); //HTTP 1.0
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
header('Content-Type: image/svg+xml');
echo(file_get_contents("https://raw.githubusercontent.com/mickael-kerjean/filestash/master/.assets/img/logo_white.svg", true));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment