Orionsbelter Posted August 19, 2008 Share Posted August 19, 2008 hi i have a forum on my website and my users can message each other, i want to do a string replace for makin a link for clicking on a users name to view thier profile. i want [user]Username[/user] to change to "a href='profile.php?viewuser=username'>Username</a> but as you can see i would need to type Username twice one to link it to the right viewuser and one for the link name, but some people put a different name for the link so how can i do a string replace so you only have to type the username once Quote Link to comment Share on other sites More sharing options...
Fadion Posted August 19, 2008 Share Posted August 19, 2008 I'm not getting this right. You want to have BBCode-like tags and replace them with real < a > tags? If so, a link should be: [link=http://www.somesite.com]Click me[/link] In your specific case, if you have code to show usernames, you can just add the link to their profile. Why's the need of having tags and replace them. Probably i'm not understanding what you mean, so please be more specific. Quote Link to comment 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.