coldwerturkey wrote:if(strstr($rightlink, "domain.com"))
As noted on the [man]strstr[/man] page, this sort of test is always better done using [man]strpos[/man].
For the original question, though, it still might not be enough - domain.com could easily turn up in other places in the URL than just the hostname (think referral links). You could limit the search to just the hostname by using [man]parse_url[/man] on the URL first and then check the host part with strpos (or stripos if you want to catch different capitalisations).