ok....i guess it would help if i posted my other code....
what i am trying to do is grab all of the links on the site that i specify and display them, and see how many times a certain link that i set is located on that site without displaying it with the other links.
<?php
$link=0;
$url = 'http://www.revolutionmyspace.com';
//$url = 'http://www.sparkletags.com';
$shorturl1 = explode(".", $url);
$shorturl = $shorturl1[1].".".$shorturl1[2];
$lines = file($url);
echo $shorturl."<br>";
foreach ($lines as $line_num => $line) {
$cutline = explode("<", $line); // Make sure there are no more links on the same line ">"
foreach($cutline as $cut){
preg_match('|href=[\'"]([^\'"]+)["\']|i', $cut, $part); // change back to $line if needed
//var_dump($part);
$href=$part[1];
if($href=="") $href=$part[6];
if($href != "" && stristr($href, $shorturl) === FALSE && $href != "" && stristr($href, "http") === FALSE){
$stripped=explode("?PHPSESSID", $href);
$stripped=explode("&PHPSESSID", $stripped[0]);
$pagetype = explode(".", $stripped[0]);
$type=$pagetype[1];
if($type != "css"){
echo $stripped[0]."<br>";
}
}
}
if(stristr(htmlspecialchars($line), "http://www.sparkletags.com/index.php") !== FALSE){
$link++;
}
}
echo $link;
?>