OpenCrypt - Membership Software
Username:
Password:
Register / My Account / Forgotten Password?
 Home  Features and Benefits  Online Demonstration  Purchase  Our Services  Help and Support  my.OpenCrypt 
 Welcome  New Visitor  Latest NewsRSS Feed Company Information  Press/Testimonials  Frequently Asked Questions  BlogNew Content
PHP Function for Reciprocal Linkback Checking
Tuesday 19th August 2008

A PHP function for reciprocal linkback checking, the function will check the supplied URL for a link back and can also validate whether or not the link has a nofollow tag which will prevent search engines from indexing the link or playing relevance to the linkback.
 
The function is especially useful if you run a link exchange and want to automatically validate each user is linking to your own web site before you link to their web site. You may also find the function useful for validating links in your own web site content, for example the function could be used to find typos or out-of-date links.
 
Usage

Simply use the following to check a URL and return the response to the variable, $reciprocal_linkback:
 
require "reciprocal_linkback.php";
$linkback = reciprocal_linkback("http://ionix.ltd.uk/",
 "http://www.opencrypt.com");
 
Then setup the conditions as you require:
 
if ("$linkback"=="1") {

	print "Link found";

} elseif ("$linkback"=="2") {

	print "Unable to read URL";

} else {

	print "Link not found";

}
 
To enable the 'nofollow' checking use the following code (note the addition of the ,1):
 
require "reciprocal_linkback.php";
$linkback = reciprocal_linkback("http://ionix.ltd.uk/",
 "http://www.opencrypt.com", 1);
 
The three input flags are used as outlined below:
 
reciprocal_linkback("URL TO CHECK", "URL TO FIND",
"ENABLE NOFOLLOW CHECK");

  • URL TO CHECK

    This is the URL of the page where we are trying to find the link. Enter a full URL, e.g. http://www.locked-area.com/
    A trailing slash or filename are not needed.

  • URL TO FIND

    This is the URL of the page the 'URL TO CHECK' should be linking to. Enter the URL you want to find, it is recommended you just check for your domain to reduce complication. e.g. http://ww.opencrypt.com
    You can add a trailing slash or filename but this may reduce the reliability of the check.

  • ENABLE NOFOLLOW CHECK

    If enabled, the function will check if the link to 'URL TO FIND' contains a 'nofollow' tag, if this is present then search engines will not index the page and the linkback will not for example improve your pagerank. Set to '1' to enable, leave blank or set to '0' to disable.

 
Responses

1
Link was found successfully.
 
0
Link was not found, or nofollow check has failed.
 
2
Unable to read 'URL TO CHECK'.
 
License and Download

This code is Open Source and is released under the GNU General Public License.
   
We hope you find this code of use, if you use it in your projects we'd love to hear about it! And of course, if you have any questions please don't hesitate to post a comment and we will respond as soon as possible.
 
Syntax highlighting powered by JUSH

 
Share this article:
Delicious Stumble It!
Stumble It!
 
<- AJAX Tree Menu with PHP - Revisited
 
AJAX Calendar with PHP and mySQL ->
Articles
Subscribe to RSS Feed
PHP Security Tips - Part 1
OpenCrypt 1.8 New Feature Highlights
Video Conversion API
We're on Twitter!
IP Location API
Integrating OpenCrypt's PHP Login Interface
Developing Mobile Web Sites
Service Recovery
Building relationships with your customers
Doing the unexpected
PHP/JavaScript World Map with Continent and Ocean Selection
We've Moved!
Customer Showcase: A-Z-Animals.com
Optimising your secure content for Google
Membership business models
AJAX Calendar with PHP and mySQL
PHP Function for Reciprocal Linkback Checking
AJAX Tree Menu with PHP - Revisited
What is membership software?
Login form designs and inspiration
PHP subscriber counter with Addicted to Feedburner class and Feedburner Awareness API
AJAX Tree Menu with PHP
AJAX data listings engine with PHP and mySQL (BETA)
Join the ionix Team!
Press Release: OpenCrypt 2.0 in Development!
PHP: Basic functions for quickstart PHP framework
Welcome to the OpenCrypt Blog!
Visitor Comments
OpenCrypt Team 10 out of 10
Space Holder
Shel, what error do you receive?
 
Harry, contact your system administrator and check fsockopen is configured correctly.

Space Holder
Space Holder
Harry 1 out of 10
Space Holder
i am not able to work with this code plz help me out. it showing error
1. Warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: Name or service not known in ....
Plz help me asap
i'l b greatful to u

Space Holder
Space Holder
Shel 2 out of 10
Space Holder
Sorry, but my code is not executing. i hv downloaded the zip file - made changes in example.php -- (changed urls) 2nd file changed port no and hd added hostname (which ws blank) if i dont mk changes in 2nd file then result is link not found
Plzzzzzzzzzzz help me out

Space Holder
Space Holder
Younten Jamtsho 10 out of 10
Space Holder
great that was what i was looking for!!!
Space Holder
Space Holder
Average Rating: 9.31 out of 10 (137 Votes)
Space Holder
Submit Comment
Space Holder
Article Rating:
Space Holder
Your Name:
Space Holder
Your Comment/Response:
Space Holder
Space Holder
Space Holder

Follow us on Twitter

Copyright © 1999 - 2009 ionix Limited. Company Information, Affiliates, Contact Us

Powered by OpenCrypt Membership Software