Need help with clickable hyperlinks

Discussion in 'PHP' started by marketinggallery, Apr 13, 2008.

  1. #1
    Currently I'm using the following code, which allows a url to be clickable:

    <?=
    makeClickableLinks(str_replace(chr(13),"<br>",strip_tags($rshome["article_summary"],"<b><strong><i>
    <em><u><br><pre><blockquote><a><xmp><ol><ul><li>")));?>

    However, if I try to add hyperlinks, such as <a href= "http://www.mysite.com/page.htm">display text</a> it will NOT display the clickable link.

    How do I modify the php/html to allow hyperlinks?

    Any help would be much appreciated! Thank you.
     
    marketinggallery, Apr 13, 2008 IP
  2. Barti1987

    Barti1987 Well-Known Member

    Messages:
    2,703
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    185
    #2
    What is makeClickableLinks()?

    Peace,
     
    Barti1987, Apr 13, 2008 IP
  3. extromaster

    extromaster Guest

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    yes, makeClickableLinks must be a function of some sort,
    copy the whole script here so we could help, or at least copy makeClickableLinks() function
     
    extromaster, Apr 14, 2008 IP
  4. marketinggallery

    marketinggallery Peon

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Here is the section from the func.php:
    ------------------------

    function makeClickableLinks($text) {
    $text = eregi_replace('(((f|ht){1}tp://)[-a-zA-Z0-9@:%_\+.~#?&//=]+)','<a href="\\1" target=_blank>\\1</a>', $text);
    $text = eregi_replace('([[:space:]()[{}])(www.[-a-zA-Z0-9@:%_\+.~#?&//=]+)','\\1<a href="http://\\2" target=_blank>\\2</a>', $text);
    $text = eregi_replace('([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3})', '<a href="mailto:\\1">\\1</a>', $text);
    return $text;
    }

    -----------

    Thanks for offering to help!
     
    marketinggallery, Apr 14, 2008 IP
  5. marketinggallery

    marketinggallery Peon

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Can anyone offer a solution to my problem?
     
    marketinggallery, Apr 17, 2008 IP
  6. marketinggallery

    marketinggallery Peon

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I found a solution from someone at ScriptLance.com

    Thanks to all who offered to help!
     
    marketinggallery, Apr 22, 2008 IP