Create link script/ Parse URL, email
Posted: Sun Apr 06, 2008 4:44 pm
Hi,
This might sound confusing but i'll try to explain the best I can.
I'm using Noah's Classifieds system on my website and want to expand it a bit. I have description outputted from database and HTML code being filtered using htmlspecialchars function. However I want to keep URLs' and email's links active, i.e. keep htmlspecialchars function and include another function, let's say I call it enableLink() that will process description value to avoid enabling other HTML tags like table, div etc.
Example:
Description is:
A Real Business For Real People Serious About Getting Real Results. CEO Income From Home.
http://retirewithroyal.com
My board outputs without url being clickable: http://bcfreeclassifieds.com/index.php? ... owhtmllist
I want script to find http:// or www. and replace them to include <a href=" URL " taget="_blank">URL goes here</a>
Same for email.
I cannot change value in database because if I add <a href ... >code it will output it as string using html ascii codes.
I see that this board has some kind of script like this.
Does it make sense?
Any help is appreciated!
Anton
This might sound confusing but i'll try to explain the best I can.
I'm using Noah's Classifieds system on my website and want to expand it a bit. I have description outputted from database and HTML code being filtered using htmlspecialchars function. However I want to keep URLs' and email's links active, i.e. keep htmlspecialchars function and include another function, let's say I call it enableLink() that will process description value to avoid enabling other HTML tags like table, div etc.
Example:
Description is:
A Real Business For Real People Serious About Getting Real Results. CEO Income From Home.
http://retirewithroyal.com
My board outputs without url being clickable: http://bcfreeclassifieds.com/index.php? ... owhtmllist
I want script to find http:// or www. and replace them to include <a href=" URL " taget="_blank">URL goes here</a>
Same for email.
I cannot change value in database because if I add <a href ... >code it will output it as string using html ascii codes.
I see that this board has some kind of script like this.
Does it make sense?
Any help is appreciated!
Anton