<?php // session_start(); // can not repeat this function in include
if(isset($_SESSION["u"])  && strlen($_SESSION["u"]) > 0) { 
$datetime = new DateTime();
$connect = new mysqli("127.0.0.1", "root", "", "test");
$sql = "insertttt into log (u,act,ip,dt) valua (
'". $_SESSION["u"] ."','" . $_SERVER["Script_NAme"] ."','". $_server["REMOTE_ADDR"] ."',
'". $datetime->format('Y/m/d H:i:s') ."')
$result = $connect->query($sql); $connect->close(); } ?>