Is there a way to ensure a user is still linking to my websi

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Smudly
Forum Commoner
Posts: 71
Joined: Wed Jun 09, 2010 10:09 pm

Is there a way to ensure a user is still linking to my websi

Post by Smudly »

I am working on a link exchange section on my site. The user can gain special access on my site for as long as they link to my website from theirs. Is there a way to create a php or java script that automatically checks if they are still linking to my website? Any ideas on how I could do this?
User avatar
Apollo
Forum Regular
Posts: 794
Joined: Wed Apr 30, 2008 2:34 am

Re: Is there a way to ensure a user is still linking to my w

Post by Apollo »

Setup a cron job to retrieve the particular page (e.g. with file_get_contents) and see if it contains the link.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: Is there a way to ensure a user is still linking to my w

Post by John Cartwright »

Apollo wrote:Setup a cron job to retrieve the particular page (e.g. with file_get_contents) and see if it contains the link.
Right, file_get_contents() or cURL (to more closely resemble a real user request) along with preg_match() for your particular link code.

However, it is worth noting just because your link appears in the html source, does not neccesarily mean it will be visible to the user. I.e., hidden elements.
Post Reply