Jump to content

link problem


Orionsbelter

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.