Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Suppress Hyperlink to Display as Plain Text

7:11 pm on Dec 25, 2013 (gmt 0)

I have an odd problem. I am trying to echo <a href='LINK'>TEXT</a> as plain text rather than a link, but no matter what I do it is converted to a clickable link that obviously gives an error when clicked. I read somewhere that by putting it in <span class="plain"></span> tags it would suppress the html but it doesn't work. I even tried using <br> between the various parts, and it still displays as clickable.

Any thoughts on this odd problem?
9:32 pm on Dec 25, 2013 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month

If you don't want it to be a link, why are you printing it as a link? You can easily add CSS to make the link blend in visually
a.subtle {text-decoration: none; color: inherit;}

but if someone mouses-over, it's still a link.

The subject header made me laugh, because the very first words of php I ever learned were for this exact purpose:

if ($pagename[$count][0] . ".html" == $given)
  { echo $pagename[$count][1]; }
  { echo "<a href = \"/hovercraft/" . $pagename[$count][0] . ".html\">" . $pagename[$count][1] . "</a>"; }

There are undoubtedly several dozen more elegant ways to achieve the same effect. Well, there could hardly be a less elegant way ;) In my case, the link suppression wasn't about errors. It just gives me the fantods when a page links to itself.
11:34 pm on Dec 25, 2013 (gmt 0)

If you don't want it to be a link, why are you printing it as a link?

I have a section for notes in a form where a user can add whatever comments they want (that only show up for themselves) and I wanted to be able to add a hyperlink option. Since I know that will take time to do, I wanted to have text they could copy and paste that have the format they could then add to until I figure out how to do what I REALLY want.

Eventually as I said I would like to have a link above that textarea that says "Add a Link" and the person could click it and enter in the URL and Display text and it would add the link in for them. I suppose I could just work on the real goal and not spend time on the bandage lol.

Thanks for the response.

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month