Forum Moderators: martinibuster

Message Too Old, No Replies

Script for anchor text linking

I am looking for a script that would do anchor text linking for me.

         

Nova

4:14 pm on Nov 21, 2003 (gmt 0)

10+ Year Member



Hi everyone,

I am looking for a script that would do anchor text linking for me. I did a search here but could not find anything.

I know there must be something like this: the script has an array of keywords and links associated with those keywords. So it parses the content, finds the keywords and inserts links in the right places.

Thanks for your help,
Nova

panic

12:17 am on Nov 25, 2003 (gmt 0)

10+ Year Member



Here's the PHP solution to it

<?php
$file = file("keywords.txt"); //Opens the text file

foreach($file as $line){
$line = trim($line);
$split = split("\t",$line); //Splits the line by a tab

print "<a href=\"$split[0]\">$split[1]</a><br>";
}

?>

Keywords.txt should look something like this :

http://www.webmasterworld.com(tab)Webmaster World
[mydomain.com(tab)My...] Domain

Etc etc.

-panic

nakulgoyal

6:38 am on Dec 20, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



wow...that was nice. :-)