homepage Welcome to WebmasterWorld Guest from 54.196.24.103
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Website
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Suppress Hyperlink to Display as Plain Text
nickelman




msg:4633562
 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?

 

lucy24




msg:4633569
 9:32 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? 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]; }
else
  { 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.

nickelman




msg:4633576
 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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved