need help with links


#1

Hi guys
I have a question if there is any option to check( using PHP) if the links pointing to our site are still up there. I want to make sure if I exchange links the other people keep they word


#2

How do you want to check?

Analytics will track where someone came in from, but if there isn’t much traffic that isn’t a guarantee.
You could do an indexOf on a page to see if the link is on a page, but you would have to know what specific page to look on.


#3

I manage to find something like this:
[php]
$domain=$final[1];
$srcUrl=‘http://www.amber-rottis.pl/’;
$html = file_get_contents($srcUrl);

$dom = new DOMDocument();
@$dom->loadHTML($html);

// grab all the on the page
$xpath = new DOMXPath($dom);

//finding the a tag
$hrefs = $xpath->evaluate("/html/body//a");

//Loop to display all the links
for ($i = 0; $i < $hrefs->length; $i++) {
$href = $hrefs->item($i);
$url = $href->getAttribute(‘href’);
//Filter the null links
if($url!=’#’ )
{
echo “”.$url."";
echo “
”;
}
}

}

[/php]
but now I need to check like 30 website for links