Php Referer Script
I hacked together / mutated a php referer script.
Yes I know it should be “PHP Referrer”, but someone fucked up a looong time ago while doing the HTTP specs.
You just modify the script and dump this snippet in your MT-template or elsewhere:
<?php
require("/path/yourhomedir/weblog/MT-referers.php");
getReferers();
?>
You must make your index file a .php file to execute the script.
And, depending on the server setup, you migth experience errors when php tries to parse <?XML. It happens because the php.ini file has allowed short open tags for php (<?...?>instead of <?php ... ?>). To override this setting you place an .htaccess file in the mt-referers.php directory with this line of code:
php_value short_open_tag 0
If you are running safe_mode, you will not be able to use this script as it uses the tail command line tool. Sorry about that ;-)
It is a modification of PHP Referer 0.1
Note that this script doesn’t require Movable Type. That’s just how I use it. All you need is a php site running on unix/linux.
update 17/11-2003: The script now takes a filter-file with domains to ignore. See my filter file for inspiration.
update 22/11-2003: Use firebird to maintain the filter-file
20. January 2004 kl. 14:10
I have slightly modified your script, so it fits into my blogging system (which is Pivotlog.net). It works perfectly ! Thanks for sharing.
17. January 2006 kl. 10:32
This look like very easy and useful, especially with domain filter, I think I’ll use it soon!