Jump to content
xisto Community
galexcd

Creating Link In Html - Help Me With This!

Recommended Posts

edit: Neeeaavverrrminddd.....I was a total noob at php when i posted this and I needed help doing something with bbcode in php and didn't really know what I was saying.. :) Anyway topic resolved...

Edited by alex7h3pr0gr4m3r (see edit history)

Share this post


Link to post
Share on other sites

Frankly, I don't understand what you are asking for! Are you trying to replace the hyperlink format of links: <a href=http://forums.xisto.com/no_longer_exists/ you own format:_example.com/_If you use PHP, this is possilble... but using plain HTML, it is not possible to create hyperlinks in the format:_link.abc/_

Share this post


Link to post
Share on other sites

Frankly, I don't understand what you are asking for! Are you trying to replace the hyperlink format of links: <a href=example.com;http://www.example.com/;
with you own format:
_http://www.example.com/_

If you use PHP, this is possilble... but using plain HTML, it is not possible to create hyperlinks in the format:
_link.abc/_


Ive got a page called bb.php with 2 arrays of strings i want to replace in the profiles of the people on my site... For example I replace < with &lt; and i relpace > with &gt; and i replace a new line with <br> and i replace {img} with <img src= and {/img} with >. I want to figure out what i can replace {url} and {/url} with so when people put a url between, it will link to it

Like this:
{url}http://www.example.com/
<a href=example.com;http://www.example.com/;

Unfortunatly to do this, i had to put in the link twice, If i have to, I know how to do it, but it would be much more complex of a php code, I was wondering if there is a simple HTML explanation that i could add code in front and in back of a url to make it link.


Note:
all {'s and all }'s are really ['s and ]'s, but i didn't want trap 17 to replace them....

Share this post


Link to post
Share on other sites

I want to figure out what i can replace {url} and {/url} with so when people put a url between, it will link to it

 

Like this:

{url}http://www.example.com/

<a href=example.com;http://www.example.com/;

 

 


Unless I'm badly mistaken, that is not the bbcode syntax for posting a url. A url would look like this:

 

[url = https://www.google.de/?gfe_rd=cr&ei=BwkjVKfAD8uH8QfckIGgCQ&gws_rd=ssl ] Google! [/url ]

 

to render the following link:

 

Google!

 

I think a preg_replace in php should do the trick quite easily. Replace all [/ url]http://forums.xisto.com/ with </a> and all with ">. Or > and < instead of > and <, respectively. Only the last replace is a little tricky, and should be used with care. I cannot comment very much without further details, but I hope you get the general idea.

 

Having said that I hope I did not misunderstand what you were trying to say... sorry if that is the case!

 

Ping back with your further concerns :)

Share this post


Link to post
Share on other sites

No clue what you are asking for. But i guess you are asking for how to display the <a href ...... tag also in your page.There are lots of special chars in HTML which has to be represented with special codes like   for space. refer w3schools.com for the corresponding codes for the special characters in your content to be displayed

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.