Loading ...
Sorry, an error occurred while loading the content.

transform links into clickable links

Expand Messages
  • Mohamed Badr
    Hi guys i have a problem, i have a text box for users to enter some articles, i need if the user put a link in the text like http://www.website.com the link is
    Message 1 of 4 , Aug 2, 2008
    • 0 Attachment
      Hi guys
      i have a problem, i have a text box for users to enter some articles, i need if the user put a link in the text like http://www.website.com the link is transformed to a clickable link not just a plain text when i retrieve the data from the database, how can this gets done ??
      thanks
       
      Mohamed Badr
       
    • Rex Limbaro
      Please modify your design and check your data type on your database. ... From: Mohamed Badr Subject: [phpResource] transform links into
      Message 2 of 4 , Aug 2, 2008
      • 0 Attachment
        Please modify your design and check your data type on your database.


        --- On Sun, 8/3/08, Mohamed Badr <badr@...> wrote:
        From: Mohamed Badr <badr@...>
        Subject: [phpResource] transform links into clickable links
        To: phpresource@yahoogroups.com
        Date: Sunday, August 3, 2008, 6:14 AM

        Hi guys
        i have a problem, i have a text box for users to enter some articles, i need if the user put a link in the text like http://www.website. com the link is transformed to a clickable link not just a plain text when i retrieve the data from the database, how can this gets done ??
        thanks
         
        Mohamed Badr
         

      • Atif Majid
        Hi I think you can do this using regular expressions. Just try to use regular expressions to find out link in the text and then make it click able. Regards
        Message 3 of 4 , Aug 2, 2008
        • 0 Attachment
          Hi
          I think you can do this using regular expressions. Just try to use regular expressions to find out link in the text and then make it click able.
          Regards
           
          Atif Majid
          Software Developer.
          Tawasul Telecom
          Kuwait Free Zone, Block C-28, D9, Shuwaik, Kuwait
          Phone: +965 461 34 91 Ext: 335
          Mobile: +965 708 53 95
          www.tawasultele.com


          ----- Original Message ----
          From: Mohamed Badr <badr@...>
          To: phpresource@yahoogroups.com
          Sent: Sunday, August 3, 2008 1:14:33 AM
          Subject: [phpResource] transform links into clickable links

          Hi guys
          i have a problem, i have a text box for users to enter some articles, i need if the user put a link in the text like http://www.website. com the link is transformed to a clickable link not just a plain text when i retrieve the data from the database, how can this gets done ??
          thanks
           
          Mohamed Badr
           

        • Mohamed BADR
          thanks a lot, i made some searches and here is the code
          Message 4 of 4 , Aug 3, 2008
          • 0 Attachment
            thanks a lot, i made some searches and here is the code

            <?
            function replace_plain_text_link($plain_text) {
            $url_html =
            preg_replace('/(?<!S)((http(s?):\/\/)|(www.))+([w.1-9\&=#?-~%;]+)/', '<a
            target=_blank href="http$3://$4$5">http$3://$4$5</a>', $plain_text);
            return ($url_html);
            }
            echo replace_plain_text_link('hi this is dummy text before the link
            http://www.smjdesign.com hi this is dummy text after
            and also here is my personal website http://www.mohamedbadr.com please
            check the site')

            ?>
            --
            Mohamed Badr
            Senior Web Application Developer
            OMEGA SOFT KSA
            +2 0102050009
            +966 564270005

            > Hi
            > I think you can do this using regular expressions. Just try to use regular
            > expressions to find out link in the text and then make it click able.
            > Regards
            >
            >
            > Atif Majid
            > Software Developer.
            > Tawasul Telecom
            > Kuwait Free Zone, Block C-28, D9, Shuwaik, Kuwait
            > Phone: +965 461 34 91 Ext: 335
            > Mobile: +965 708 53 95
            > www.tawasultele.com
            >
            >
            >
            > ----- Original Message ----
            > From: Mohamed Badr <badr@...>
            > To: phpresource@yahoogroups.com
            > Sent: Sunday, August 3, 2008 1:14:33 AM
            > Subject: [phpResource] transform links into clickable links
            >
            >
            > Hi guys
            > i have a problem, i have a text box for users to
            > enter some articles, i need if the user put a link in the text like
            > http://www.website com the link is transformed
            > to a clickable link not just a plain text when i retrieve the data from
            > the
            > database, how can this gets done ??
            > thanks
            >
            > Mohamed Badr
            >
            >
            >
            >
          Your message has been successfully submitted and would be delivered to recipients shortly.