[SOLVED]Automatic Link Creation
Moderator: General Moderators
[SOLVED]Automatic Link Creation
I want to have a database of URLs associated with text strings, and whenever one of those strings is typed, I would like it to automatically convert to a link. Is this at all possible?
Sorry, I guess it's that I'm just kinda new to PHP, but this doesn't help at all. I know what link does. But how would I get this to associate with a database of predifined urls, and more importantly, how would I get it to dynamically update those text strings into links every time that I post to my page?
PS - I'm not asking anyone to write a script for me. But maybe point me to a similar script that I can learn from. Or throw some ideas at me.
PS - I'm not asking anyone to write a script for me. But maybe point me to a similar script that I can learn from. Or throw some ideas at me.
You will need to
a) query the database (I suggest a while-loop), probably with sorted with MySQL's "ORDER BY"
b) in that loop have your string-to-URL converting code
c) output it
There's a tutorial on database access etc at http://hotwired.lycos.com/webmonkey/99/21/index3a.html ,
PHP's [php_man]MySQL[/php_man] functions and some worthwhile sample-chapters to download at http://www.sitepoint.com/books/phpmysql1/
a) query the database (I suggest a while-loop), probably with sorted with MySQL's "ORDER BY"
b) in that loop have your string-to-URL converting code
c) output it
There's a tutorial on database access etc at http://hotwired.lycos.com/webmonkey/99/21/index3a.html ,
PHP's [php_man]MySQL[/php_man] functions and some worthwhile sample-chapters to download at http://www.sitepoint.com/books/phpmysql1/