kurt.santo Posted March 10, 2008 Share Posted March 10, 2008 Found this marvellous site, where you can enter a url and it scans the entered url for the existance of a back link. THe code is: function ConfirmWebLink(){ var webaddress = getObj('website').value; var allowWebsite = getObj('allow_website').value; if (webaddress != '' && allowWebsite != 'true') { var chk_webaddress = Trim(webaddress.toLowerCase()); chk_webaddress = Replace(chk_webaddress,'http://',''); chk_webaddress = Replace(chk_webaddress,'https://',''); chk_webaddress = Replace(chk_webaddress,'index.html',''); chk_webaddress = Replace(chk_webaddress,'index.htm',''); chk_webaddress = Replace(chk_webaddress,'index.php',''); chk_webaddress = Replace(chk_webaddress,'home.html',''); chk_webaddress = Replace(chk_webaddress,'home.htm',''); chk_webaddress = Replace(chk_webaddress,'default.htm',''); chk_webaddress = Replace(chk_webaddress,'default.html',''); chk_webaddress = Replace(chk_webaddress,'/default.aspx',''); chk_webaddress = Replace(chk_webaddress,'default.asp',''); chk_webaddress = Replace(chk_webaddress,'home.php',''); strLen = chk_webaddress.length; if ((chk_webaddress.substr(strLen-1,1)) == '/') { chk_webaddress = chk_webaddress.substr(0,strLen-1) } if (chk_webaddress.indexOf("/") > 0) { alert('That doesn\'t appear to be your homepage.\n\n- Only links on your homepage are accepted.\n- Link pages or other pages on your site won\'t be accepted.\n- Homepages that re-direct to other URLs may also cause problems.\n\nPlease contact us if the link on your homepage is not being found.') getObj('upgrade_disabled').style.display = 'block'; } else { getObj('iframe-line').style.display = 'block'; getObj('pagescan').style.display = 'block'; getObj('scanning').style.display = 'block'; getObj('pagescan').src = '/customscripts/pm_pagescan.asp?url=' + webaddress; } } else if (webaddress == '') { alert("A web address (URL) has not been entered."); }} I just do not get where you have the parameters for the link you are checking. Is this in the asp bit and if yes, how could you write a script that would do that? I appreciate any suggestions. Maybe there is a good how to tutorial?Kurt Link to comment Share on other sites More sharing options...
Synook Posted March 10, 2008 Share Posted March 10, 2008 If you look in the getObj() function you'll find out - it looks like it gets them from <input>s. Link to comment Share on other sites More sharing options...
kurt.santo Posted March 10, 2008 Author Share Posted March 10, 2008 If you look in the getObj() function you'll find out - it looks like it gets them from <input>s.Sorry, mate. Did not explain what I do not understand, so anyone else can understand what I mean;-) I mean if I am abc.co.uk and I want to check if xyz.co.uk has my link on their site. I can see that where the function gets the website to check (which is xyz.co.uk). But how does it know that it has to check for the link "http://www.abc.co.uk" on xyz.co.uk?Kurt Link to comment Share on other sites More sharing options...
justsomeguy Posted March 10, 2008 Share Posted March 10, 2008 That's not in the Javascript, it's probably in the ASP file that they reference. Link to comment Share on other sites More sharing options...
kurt.santo Posted March 11, 2008 Author Share Posted March 11, 2008 That's not in the Javascript, it's probably in the ASP file that they reference.Understand. Do you know by any change good tutorials to do that? Could that also be done with PHP?Kurt Link to comment Share on other sites More sharing options...
justsomeguy Posted March 11, 2008 Share Posted March 11, 2008 Yeah, you can use PHP. You can use something like file_get_contents to get the code on the remote page, and then search for a regular expression pattern for a link with a certain URL in it. Link to comment Share on other sites More sharing options...
kurt.santo Posted March 12, 2008 Author Share Posted March 12, 2008 Yeah, you can use PHP. You can use something like file_get_contents to get the code on the remote page, and then search for a regular expression pattern for a link with a certain URL in it.Cheers, that is a good starting point. Try to Google for a bit more info on how to do that...Kurt Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.