473,503 Members | 2,163 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

php to display mysql output text as hyperlink

Hi,

Not sure if this goes to PHP or mySQL group (or both!).

I've got a home brewed blog started using PHP and mySQL to store and
display the entries/postings.

I've figured out that I could format the way the entries are displayed
from the database using nl2br2($string) to properly display paragraph
breaks.

How can I parse the output and display a hyperlink one types in the
body of the entry, into an actual link.

If the body text looks like this for example:
Today I went to the zoo. If you want to visit the zoo, look at their
homepage at www.zoo.com I think you'll like it a lot.

How can I get the output to be parsed, recogonize http:// or www. and
convet the plain text to an actual hyperlink?

Much thanks to those who can offer insight!!

Chris

Aside from the dull entry,

Aug 23 '07 #1
1 2510
..oO(xx75vulcan)
>How can I parse the output and display a hyperlink one types in the
body of the entry, into an actual link.

If the body text looks like this for example:
Today I went to the zoo. If you want to visit the zoo, look at their
homepage at www.zoo.com I think you'll like it a lot.

How can I get the output to be parsed, recogonize http:// or www. and
convet the plain text to an actual hyperlink?
Could be done with a regular expression, but it won't be reliable. Not
every URL starts with HTTP or a leading 'www'. What about using BBCode
or something like that?

Micha
Aug 23 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
9470
by: deko | last post by:
I store hyperlinks as text in a table like this: Invoice11-21-2003.pdf#file://P:\Finance\PrefVendors\Receipts\Invoice11-21-20 03.pdf I need to run a report that lists the documents - or...
6
2213
by: dee | last post by:
Here is a a list of my hyperlinks in my home page: <A class="theclass" href="Default.aspx">Home</A> <A class="theclass" href="Search.aspx">Search</A> <A class="theclass"...
5
2490
by: Stephen | last post by:
Hi, Is there anyway I can make a column thats databound into a hyperlink to navigate to another page? Suppose I have 3 columns: SortOrder, Description, UserName for eg: <Columns>...
6
5920
by: Bill Nguyen | last post by:
I'm getting data from a mySQL database (default char set = UTF-8). I need to display data in Unicode but got only mongolian characters like this: Phạm Thị Ngọc I changed the textbox font to...
1
3203
by: satish.vell | last post by:
Hi, I have a ASP.NET page inside which I toggle the display of a field using javascript. How can I save this display value between postbacks. Here is my code: <pre>
3
3173
by: BOBss | last post by:
I am using ASP with VBScript. I want to query an access database username field, and display the output as a hyperlink on an a webpage.The webpage will display all records. I then need to be able...
0
1564
by: netventuresmarketing | last post by:
Ok so you have already figured out with a name like netventuresmarketing that Im a Internet marketing type trying to teach myself some simple PHP. I purchased a turnkey program to set up a free...
8
2334
by: kumarboston | last post by:
Hi All, I have a mysql database and 3 pages which queries and returns the data. 1st page(main.html) is just a form in html which takes query from the user and is connected to "form...
1
1737
by: mramsay | last post by:
Hi there, I have a dynamic hyperlink Baseball. When the user select the hyperlink they are redirected to another page. After that I want to display information on the page from my linkstbl. ...
0
7093
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7353
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7011
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7468
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4689
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3180
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3170
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1521
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
401
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.