Begginer needs big help on a href function

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
vestmar
Forum Newbie
Posts: 4
Joined: Sun Sep 13, 2009 2:31 pm

Begginer needs big help on a href function

Post by vestmar »

Hy everyone.

This string:

$swRegisteredMessage = '{domain} is <span style="color: red;">Registered.</span>';

Returns:

boys.com is Registered.

How can I use the "a href" function in my string, to be able to click on and go to "boys.com"?

THanks in advance for your answers!

V.
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: Begginer needs big help on a href function

Post by jackpf »

Umm...I don't think an anchor tag is any sort of function....but whatever.

Have you tried putting

Code: Select all

<a href="http://{domain}">domain</a>
??

I can't say exactly, because you've not stated how this template is being parsed.
vestmar
Forum Newbie
Posts: 4
Joined: Sun Sep 13, 2009 2:31 pm

Re: Begginer needs big help on a href function

Post by vestmar »

YEAP your the king :)

It works ok BUT:
1) the ".com" dissapears
2) how can i make it open in a new window

THANKS AGAIN KING ;)

v.
vestmar
Forum Newbie
Posts: 4
Joined: Sun Sep 13, 2009 2:31 pm

Re: Begginer needs big help on a href function

Post by vestmar »

I got it my self:

the good syntax is:

$swRegisteredMessage = '<a href="http://{domain}" target="_blank" >{domain}</a> is <span style="color: red;">Registered.</span>';

Thanks again "King" of you kingdom :)

Believe it or not this is my third look ever in a php code :)

All the best!

P.s. I will be definitely returning as i am learning php
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: Begginer needs big help on a href function

Post by jackpf »

Lol no problem.

I only refer to it as my kingdom because I am god there 8O

You know...I created it and stuff...

But yeah, good luck and stuff.
Post Reply