rossmcl
Programmer
- Apr 18, 2000
- 128
Any help much appreciated here.
I am trying to store visitor details of people that visit that use my website. I do it to a text file as my domain provide doesnt provide MySQL (actually they do, but it is blooming expensive for my hobbyist needs.)
What I am trying to do is add the URL of the site from which a visitor came to my page.
Originally I tried using $HTTP_SERVER_VARS['REMOTE_ADDR']
but it has never done anything. So then I stumbled across $_SERVER['REQUEST_URI'] - is THIS the variable I should use to get the URL from which a visitor has clicked onto get to my page.
I have seen it working here:
(but cannot use this code because I dont have mySQL, so I am wondering what the php command is that this person is using)
Any help very much appreciated
RM
<?php
$filename = "VisitorsDetailsBlog.txt";
$handle = fopen ($filename, "a+");
$todaydate = date("Y-m-d H:i:s");
$visitorInfo = $HTTP_SERVER_VARS['REMOTE_ADDR'];
$url = $_SERVER['REQUEST_URI'];
//if ($visitorInfo == "212.159.35.224")
//{
// do nothing
//}
//else
//{
fwrite($handle, "\r\n" . $todaydate . ' ' . $visitorInfo . ' ' . $url);
//}
fclose( $handle );
?>
I am trying to store visitor details of people that visit that use my website. I do it to a text file as my domain provide doesnt provide MySQL (actually they do, but it is blooming expensive for my hobbyist needs.)
What I am trying to do is add the URL of the site from which a visitor came to my page.
Originally I tried using $HTTP_SERVER_VARS['REMOTE_ADDR']
but it has never done anything. So then I stumbled across $_SERVER['REQUEST_URI'] - is THIS the variable I should use to get the URL from which a visitor has clicked onto get to my page.
I have seen it working here:
(but cannot use this code because I dont have mySQL, so I am wondering what the php command is that this person is using)
Any help very much appreciated
RM
<?php
$filename = "VisitorsDetailsBlog.txt";
$handle = fopen ($filename, "a+");
$todaydate = date("Y-m-d H:i:s");
$visitorInfo = $HTTP_SERVER_VARS['REMOTE_ADDR'];
$url = $_SERVER['REQUEST_URI'];
//if ($visitorInfo == "212.159.35.224")
//{
// do nothing
//}
//else
//{
fwrite($handle, "\r\n" . $todaydate . ' ' . $visitorInfo . ' ' . $url);
//}
fclose( $handle );
?>