Jump to content

link active?


merylvingien

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.