Codefixer - ASP tutorials, resources and software
asp.netPRO “Best ASP.NET Host” – DiscountASP.NET
Home   Articles   Resources   ASP directory   ASP Tutorials   Code Snippets   ASP Applications   Forum
Wednesday 14 May
MembersPro PayPal - ASP Membership software

asp.netPRO “Best ASP.NET Host” – DiscountASP.NET


ASP Partner ASP Partner ASP Partner more partners...

Reciprocal Link Checker script

Download the code

<%
'Declare variables
Dim BlnLinkBack, sReciprocalURL, sReciprocalLinkURLText
BlnLinkBack=False
sLinkBackURL="www.codefixer.com" 'this is the URL we wish to check for
sReciprocalURL= "www.codefixer.com/tutorials/index.asp" 'This is the URL
'we are going to check against

If sReciprocalURL <> "" Then
'now we need to check if reciprocal link is valid and begins with http://
If Left(LCase(sReciprocalURL),7)<>"http://" Then
sReciprocalURL="http://" & sReciprocalURL
End If

On Error Resume Next
'Declare variables
Dim objXMLHTTP, sHTML
'Create an instance of the XMLHTTP object
Set objXMLHTTP = Server.CreateObject ("Microsoft.XMLHTTP")
objXMLHTTP.open "GET", sReciprocalURL, False
objXMLHTTP.send
sHTML=objXMLHTTP.statusText

If Err.number=0 OR sHTML="OK" Then
sReciprocalLinkURLText= objXMLHTTP.ResponseText
'Check if sLinkBackURL is in the text string returned
If InStr(1,sReciprocalLinkURLText, sLinkBackURL) > 0 Then
Blnlinkback=True
Else
Blnlinkback=False
End If
Else
Blnlinkback=False
End If
Set objXMLHTTP=Nothing
Else
linkback=False
End If

If Blnlinkback=False Then
response.write "No reciprocal link given. "
Else
response.write "Yes there is a reciprocal link given. "
End If
%>





If you have any code snippets to share with full credit given then send an email to Codesnippets - You'll receive full credit and a link back to your site.

ASP.NET 3.5/2.0 Web Hosting: 3 Months FREE – Click Here!




About | Contact | Advertise | Feedback | Hire Us | Link

Site developed by Michael Wall - Web Design Belfast N.Ireland.
Copyright © 2000-2008. All rights reserved.

Do you intend to move to ASP.NET or have you already?
Yes will do
Have done
ASP does fine
Not a priority


Directory Software