Jump to content

Link-back script


Craig Hopson
 Share

Recommended Posts

Hi all some has asked me to right a script for them but i'm not shore what they want this is what they said to me.... i want something that will give a code of my banner...and members put that code on their websites ...then something checks to see if the code is really there..then it will allow that member to put his link on my site. Question 1...Is there a pre-made script for this already?Question 2...If not i assume i would use a cron job?Question 3...How can i make a script check another site's content? Thanks

Link to comment
Share on other sites

You can use DOM to get the html page over the network and parse them to find the exact node of your advertisement node. and to fetch users from database you are going to need CRON.

Link to comment
Share on other sites

Is there an example of this i had a little search and made this

<!DOCTYPE html><?phpecho '<h1> Testing</h1>PLEASE ADD THIS CODE TO YOUR SITES FRONT PAGE<pre style="background:green;padding:20px;"><div id="backlink"><a href="http://twitterrooms.co.uk"><img src="http://twitterrooms.co.uk/themes/charcoal/twitterrooms5.png"></a></div></pre><form action="test.php" method="post">Site: <input type="text" name="site" placeholder="http://example.com" /><input type="hidden" name="check" value="1"/><input type="submit" value="Check" /></form>';if($_POST['check'] == 1){if($_POST['site'] == ''){echo 'Please enter a site';}else{$haystack = file_get_contents($_POST['site']);$needle = '<div id="backlink"><a href="http://twitterrooms.co.uk"><img src="http://twitterrooms.co.uk/themes/charcoal/twitterrooms5.png"></a></div>';if (strpos($haystack,$needle) !== false) {    echo 'FOUND IT';}else{    echo 'ITS NOT THERE';}$_POST['check'] = 0;}}//echo'<div id="backlink"><a href="http://twitterrooms.co.uk"><img src="http://twitterrooms.co.uk/themes/charcoal/twitterrooms5.png"></a></div>';?>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...