Jump to content


Photo

[solved]if link exist on a site cheers.


  • Please log in to reply
1 reply to this topic

#1 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 30 August 2006 - 03:13 AM

Hi there can you point me in the right syntex codes for me to be able to cheek if a link exist on someones website  cheers.
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#2 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 30 August 2006 - 03:30 AM

solved
<?php 
function check_back_link($remote_url, $your_link) { 
    $match_pattern = preg_quote(rtrim($your_link, "/"), "/"); 
    $found = false; 
    if ($handle = @fopen($remote_url, "r")) { 
        while (!feof($handle)) { 
            $part = fread($handle, 1024); 
            if (preg_match("/<a(.*)href=[\"']".$match_pattern. 
"(\/?)[\"'](.*)>(.*)<\/a>/", $part)) { 
                $found = true; 
                break; 
            } 
        } 
        fclose($handle); 
    } 
    return $found; 
} 
// example: 
//if (check_back_link("http://www.all4yourwebsite.com", "http://www.finalwebsites.com")) echo "link exists"; 
?> 

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users