Categorized | News

Link to PHPkitchen, and it will link back to you :-)

Posted on 13 August 2002 by Demian Turner

(automatic backlinking for your weblog – see where your traffic is coming

UPDATED: if you have a version prior to download the latest or simply add a fully qualified URL to your blank reflog.txt file

I’ve been wanting to get a backlink script working for Geeklog for a while,
seems like they’ve become quite popular in weblog circles. There is a
Perl version that many people
seem to be using, so I took a crack at converting it to PHP but it’s a bit longwinded. Naturally PHP has many
built-in functions that make this kind of thing a lot easier than Perl 😉

To view an example of the referrer PHP Block check out , it’s on the left side under the Amazon block. The source code is available
here. I started off
Charles F. Johnson’s code from which really
is very good then modified it to display unique referrers.

Bookmark and Share

13 Comments For This Post

  1. Anonymous Says:

    I\’m sure it\’s a great block, but it doesn\’t work for me as I get these errors:

    Warning: Wrong datatype in array_unique() call in /home/finiserv/public_html/thane/system/lib-custom.php on line 206

    Warning: Invalid argument supplied for foreach() in /home/finiserv/public_html/thane/system/lib-custom.php on line 208

    Warning: Invalid argument supplied for foreach() in /home/finiserv/public_html/thane/system/lib-custom.php on line 214


  2. demian Says:

    that is bad indeed! I have it working in PHP 4.06 and 4.1.3 – what version are you using? Sounds like it might need type casting.

  3. demian Says:

    It was a simple error, the reflog.txt cannot be empty – simply insert at least one fully qualified URL in the blank file and the block will work fine. Or download the updated source at

  4. winnits Says:

    Superb block – I love it 🙂


  5. Anonymous Says:

    Using 4.2.2

  6. Anonymous Says:

    Warning: Cannot add header information – headers already sent by (output started at /www/geeklog/geeklog/system/lib-custom.php:77) in /www/geeklog/geeklog/system/lib-sessions.php on line 150

    Warning: Cannot add header information – headers already sent by (output started at /www/geeklog/geeklog/system/lib-custom.php:77) in /www/geeklog/geeklog/system/lib-sessions.php on line 162

    *** but my referrers did manage to appear (as in reflog.txt).. except for this errors that pops up right on top of the page.

    Using PHP 4.1.2

  7. Anonymous Says:

    new error

    Warning: Cannot add header information – headers already sent by (output started at /www/geeklog/geeklog/system/lib-custom.php:77) in /www/geeklog/geeklog/system/lib-sessions.php on line 263

  8. Anonymous Says:

    Great block! How did you get it to sort by hits per domain?

  9. Anonymous Says:

    as recently posted on the geeklog article, i will be releasing the next version shortly that will have a few more features including sorting.

  10. squatty Says:

    sounds good, thnx. do you have a release date in mind?

  11. Anonymous Says:

    followed instructions to a t many times…keep getting this error…

    Fatal error: Failed opening required \’/home/calvaryc/lgf-reflog.php\’ (include_path=\’\’) in /home/calvaryc/system/lib-custom.php on line 596

  12. demian Says:

    this error message is telling your that file \’lgf-reflog.php\’ doesn\’t exist in your web root or that apache doesn\’t have read permissions on the file. First verify that the file exists in the correct place, your web root is the dir where geeklog\’s config.php exists, then check the file\’s permissions. If you\’re have command line access to your server something like

    chown yourUsername lgf-reflog.php

    will do the trick.

  13. Anonymous Says:

    I modifed your code to work with sites that do not have the Geek-log installed. Works pretty good. Can see it at on the bottom right of the page. Whos permission do i have to get to post the modified version on our site for download? I know the modifications i did are not hard to do. But for most it is something they would not want to attempt.

    Scott R

Leave a Reply



Demian Turner's currently-reading book recommendations, reviews, favorite quotes, book clubs, book trivia, book lists



PHPkitchen recommends you also check out the following sites :

Accounting for Small Businesses

FreeAgent sign-up