TobesC Posted January 9, 2008 Share Posted January 9, 2008 anyone know how i can create a link from a web address typed into a text area? for instance: come to my website! http://www.mywebsite.com and make the "http:.." a link. thanks Quote Link to comment https://forums.phpfreaks.com/topic/85222-create-links/ Share on other sites More sharing options...
chronister Posted January 9, 2008 Share Posted January 9, 2008 inside the text area you can't... unless you use some javascript or something like that. I know I have seen some folks do it in a wysiwyg editor. But for the most part text boxes are only going to display text. You can make it so that a person adds a [a][/a] block around the code they want to be a link and your script replaces those with the proper <a > and </a> tags. Otherwise you could parse the whole text area and use a bit of regex to find the text that starts with http:// and ends with a blank space, then set the results in a var and make the var the link. I hope this answers your question or at least helps point ya in the right direction. Lemme know if it does not and I will try to help better. nate Quote Link to comment https://forums.phpfreaks.com/topic/85222-create-links/#findComment-434771 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.