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
https://forums.phpfreaks.com/topic/120330-link-problem/
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
https://forums.phpfreaks.com/topic/120330-link-problem/#findComment-619955
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.