Forum Moderators: phranque

Message Too Old, No Replies

Recognizing text in a forum or on a site and creating a link

automatic link generation based off of text string

         

unbeatabletechnology

10:01 pm on Jul 31, 2006 (gmt 0)

10+ Year Member



I would like to know how to recognize a string such as someone posting a message about Amazon and then having that word link to amazon.com when the post is complete automatically. This is currently used on sites like fatwallet forums e.g. (Hot Deals).

How is this done?

celgins

11:32 pm on Jul 31, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



More than likely, this is handled during the posting process through code.

One Simple Way:
You would simply have a database table (or flat file) containing the words you would like to replace (ex. Amazon, Yahoo, CitiBank, etc.) and their equivalent links (ex. <a href="">Amazon</a>, <a href="">Yahoo</a>, <a href="">Citibank</a>, etc.)

While the message is being posted, the code would search through the post for any of these words and if located (let's say it finds "Amazon"), the code replaces "Amazon" with <a href="">Amazon</a>

If there is a quicker way to do this through HTML or CSS, I'm not aware of it. Of course, the above example would need to be done through a scripting language like ASP, PHP, Perl, etc.

There are a number of commercial applications that also do this. You can sticky mail me and I'll send you a link.