View Single Post
Old 08-10-2002, 06:30 AM   PM User | #1
Jabbamonkey
New Coder

 
Join Date: Aug 2002
Location: New York, NY
Posts: 70
Thanks: 0
Thanked 0 Times in 0 Posts
Jabbamonkey is an unknown quantity at this point
Question URLs and TEXT fields

Ok, I have a database with the following text field...

"This event has been going on for the past 20 years. For more information, visit www.domainname.com or call 212.555.1234."

Well, when I print this field on a php page, I'm interested in making all urls a link. So, I'm looking to substitute any...

www.domainname.com OR http://www.domainname.com

with

<a href="http://www.domainname.com/" target="_blank">www.domainname.com</a>

In short, I'm trying to turn the above text field into:

"This event has been going on for the past 20 years. For more information, visit <a href="http://www.domainname.com/" target="_blank">www.domainname.com</a> or call 212.555.1234."

How do you go about changing elements inside a text field? I know that I could put the html in the text field, but the administrator of the database will not want to deal with that. Any ideas?

Jabbamonkey
Jabbamonkey is offline   Reply With Quote