merylvingien Posted November 18, 2009 Share Posted November 18, 2009 Hi fellas, is there a way to check if a site links to mine using php? Ive done a few searches but nothing really stands out as being straightfoward. I have a section where people can link to thier sites from mine, but i really dont want to have to manually validate every link to see if they are playing nicley. I was wondering if i can use php to go and check if they have actually put a link to my site and if so it activates thier link to thier site! Link to comment https://forums.phpfreaks.com/topic/182044-link-active/ Share on other sites More sharing options...
cags Posted November 18, 2009 Share Posted November 18, 2009 All you need to do is grab the HTML source of their page using file_get_contents or cURL, then search it to see if it contains your link. Something as simple as strpos could be used for that. Of course a system that simple will only work if it's a single page site. To expand the criteria you would have to recursively traverse their site searching for your URL. Link to comment https://forums.phpfreaks.com/topic/182044-link-active/#findComment-960236 Share on other sites More sharing options...
merylvingien Posted November 18, 2009 Author Share Posted November 18, 2009 Thanks for that Cags, i will look into and see what i can make of it Link to comment https://forums.phpfreaks.com/topic/182044-link-active/#findComment-960258 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.