Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created March 2, 2021 02:27
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save parzibyte/863442ef7d0c7050c0b06b1c76b56779 to your computer and use it in GitHub Desktop.
<?php
function registrarVisita($pagina, $url)
{
$fecha = date("Y-m-d");
$ip = $_SERVER["REMOTE_ADDR"] ?? "";
$bd = obtenerConexion();
$sentencia = $bd->prepare("INSERT INTO visitas(fecha, ip, pagina, url) VALUES(?, ?, ?, ?)");
return $sentencia->execute([$fecha, $ip, $pagina, $url]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment