Jump to content

Creating Links using [url]


imperialized

Recommended Posts

A lot of forums use this type of linking system, as to prevent users from inputting html.

 

If I wanted to include something similar in my news posting script, how would I go about this? I am not very fluent with php, I know basics, but when it comes to manipulating strings, etc, I am very new... as you can probably tell with my previous questions.

 

Anyways, to further elaborate and explain my question, I want to know how to make links like so:

 

[link url=http://xxxx](link text goes here)[/link] 

 

Furthermore, what if I wanted to do the same thing with images? Such as:

 

src=xxxxhttp://[/img] 

 

Now, I realize that I will most likely have to do

str_replace("[/img]", "</img>", $string);

 

However, I guess my real question would be how to extract the URLs into variables and place them in the right place. If this is confusing I appologize, but I appreciate any help. Thanks in advance.

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.