Well, what you are after is a little more complicated. But do able. Would be done by now if I wasn't sneaking peeks in from work.
This will get you started:
PHP Code:
<?php
session_start();
$userName = $_POST["user"];
$agent = $_SERVER['HTTP_USER_AGENT'];
$uri = $_SERVER['REQUEST_URI'];
$ip = $_SERVER['REMOTE_ADDR'];
$ref = $_SERVER['HTTP_REFERER'];
$visitTime = date("r"); //Example: Thu, 21 Dec 2000 16:01:07 +0200
if($_SESSION["logged"] != "yes")
{
$logLine = "$visitTime - IP: $ip || User Agent: $agent || Page: $uri || Referrer: $ref\n";
$fp = fopen("visitorLog.txt", "a");
fputs($fp, $logLine);
fclose($fp);
$_SESSION["logged"] = "yes";
}
?>
Basically it will track the time, page they came from, and the IP into a file named visitorlog.txt.
Next I will work on displaying the user name and the form for that as well as sending them to another page upon submission. Sorry its not all in one piece, doing it as I can, in between boss walking by my desk and doing my paying job
Bookmarks