Page 1 of 1

preg_match and more

Posted: Thu May 04, 2006 3:00 pm
by patty06
I am having problems, parts of this codes works great and parts do not work together.
Just a run down, I am doing a loop to get all of the $siteurl and of course the $recip is my site url such as http://www.site.com

If I just do the preg_match alone, it works fine for that. if I do the other alone and that works fine for that.
Here is what I am trying to accomplish so if you can help that would be great..

If a domain exist and $recip link is found on a site, echo link found.
if no link found, echo link not found
if domain doesnt exist, show link not found,
and if link is between comment tags, then show link not found..

Code: Select all

$conts = @file_get_contents($siteurl);
if((($conts = @file_get_contents($siteurl)) != FALSE) && (strpos(@file_get_contents("$siteurl"),"$recip")!==false)){
 
  if(preg_match("^<!--.*?".$recip.".*?-->^si", $conts)) 
  { 
      echo "link not found</td>";
  } 
  else 
  { 
      echo "link found</td>";
  } 
} else { 
      echo "link not found</td>";
}

Posted: Thu May 04, 2006 3:28 pm
by feyd
Sorry, we don't need two threads for the same problem by you.