PHP - Is there a NOT-complicated way to determine the position of a link on page?
<p>I would like to write a script which determines the position of hyperlinks from other domains which link to my website. For example I want to know if the link comes from "inside an article", "inside a sidebar (left / right)", "inside the footer". The only way I can think of is to check the CSS classes which wrap the link. For example a link is inside the class "left_sidebar", then it's likely inside the left sidebar :) 
But this seems like a buggy way to determine this. This may work with well designed Wordpress themes, but will fail with many other sites.</p>

<p>So is there a better way to do this? Thanks!</p>
