Hi there,
I'm new to the forums and PHP in general really and I thought I'd start off with a problem I'm having in regardds to $HTTP_REFERER.
I have this simple script which logs the referers to my site, but ever since I moved things around it stopped working properly 🙁
Instead of logging the url where people came to my site from it logs my server's details (i.e: http://66.78.26.26:2086/scripts/command). As I said, it worked once, but now just does that....
I've even downloaded a few other referers that folks have made to "test" if they work and they seem to be doing the same thing, so I guess this really isn't a PHP specific question, but I would still like people advice if you're willing to give it.
If you want to see the script to see if I've done something glaringly obvious, see below.
thanks in advance for you time and help.
Brad Lucas
$referer = $HTTP_REFERER;
$ip = $REMOTE_ADDR;
$when = date ("d/m/Y");
$database = mysql_connect("localhost", "user", "pass");
mysql_select_db("database", $database);
mysql_query("insert INTO referer (ip, url, date)
values ('$ip', '$referer', '$when')", $database);
mysql_close;
PS:
I should point out that I moved my main content from http://rat-bag.net/blog/ to just http://rat-bag.net/ so it obviously has something to do with the fact that its now on the root directory...but what?
I'm totally confused.