I've written scripts to capture the IP address of a user with the time as well as to capture the username with the time but I've tried combining these and I'm having some errors with the $text
It's almost there, just not sure why this is wrong.
<?php
$user = $_POST["PHP_AUTH_USER"];
$timestamp =date('d/m/Y H:i');
$text = "{$user} Logged in as: {$_SERVER['PHP_AUTH_USER']} at: {$timestamp} With IP: {$_SERVER['REMOTE_ADDR']
";]}
$file = fopen("./users.txt","a+
");
fwrite($file, $text);
fclose($file);
?>
Any help so that this saves and the page actually loads would be great. Thanks in advance.