This Visitor log may seem complex but it is very basic. It uses a http web server to avoid loading resources on your region.
The LSL collision method is chosen to avoid timer based Av scanner loads.
The web based visitor list can easily be emailed or applied to another dynamic web application.
Just take this LSL script and drop it into a "welcome mat" prim.
(note the needed modifications in comments)
-----------------------------------start LSL
//Borne logger V-OL-01
string last_visitor = "";
default
{
state_entry()
{
llSetAlpha(0,ALL_SIDES); //comment out when using a textured prim
}
collision_start(integer num)
{
integer i;
for (i = 0; i < num; i++)
{
string name = llDetectedName(i);
if (name != last_visitor)
{
string url = "http://sl.ippy.us/borne-visitor.php?";//CHANGE URL
url += "name=" + llEscapeURL(name);
url += "&key=" + llEscapeURL((string)llDetectedKey(i));
url += "&object=" + llEscapeURL(llGetObjectName());
llHTTPRequest(url ,[HTTP_METHOD,"GET"],"");
last_visitor = name;
}
}
}
http_response(key id,integer status, list data, string body)
}
-----------------------------------end LSL
PHP example file. set perms to 755
------------------------------------start PHP
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
<HTML>
<HEAD>
<TITLE>Borne Visitor Logger</TITLE>
</HEAD>
<BODY LINK="#FFFFFF" VLINK="#000000">
<?php
$name = htmlspecialchars($_GET['name']);
$object = htmlspecialchars($_GET['object']);
$key = htmlspecialchars($_GET['key']);
$ip = $_SERVER['REMOTE_ADDR'];
$ref = $_SERVER['HTTP_REFERER'];
$dtime = date('r');
}
if($name == ""){
$name = "nameless";
}
if($ref == ""){
$ref = "None";
}
?>
Hello <?php echo $name ?>.
thank you for visiting.
<?php
$data_line = "$dtime - IP: $ip | name: $name | key: $key | object: $object\n";
$fp = fopen("borne-visits.txt", "a");
fputs($fp, $data_line);
fclose($fp);
?>
</BODY>
</HTML>
-------------------------------------end PHP
The resultant log file example, (start with a blank file). set perms to r-w or 777
-------------------------------------start borne-visits.txt
Sun, 24 Aug 2008 01:00:27 +0000 - IP: 71.6.163.177 | name: Bri Hasp | key: 0a83a315-a4d2-498b-aeb4-c9172754a6f0 | object: Greeter Mat
-------------------------------------end