could have an intermediate script, out.php that logs the click.
i would pass a var named goto for the next page to hit, and, if you wanted, the current page (i'm not sure how to get referrer with php).
so, on index.htm,
<a href="/out.php?goto=http://phpbuilder.com">PHPBuilder.com!</a>
you'd probably want to url encode "http://phpbuilder.com