473,387 Members | 1,486 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

converting text to hyperlink in php

i need to insert a hyperlink to an sql query. there is a field in the table called url which consists of the url of a page, i would like this information to be displayed as a hyperlink so that i can click on the link.

following is the code =

$sql = " SELECT Count(*) .....";
$rs_newEnquiries = mysql_query($sql, $connEnquiry);

$echoStr = "<table width='80%' cellpadding=1 cellspacing=1 border=0><tr bgcolor='#cccccc;'><th bgcolor='#cccccc' width=10>Count</th><th bgcolor='#cccccc' width=400>Url</th></table>";
while ($row_rs_newEnquiries = mysql_fetch_assoc($rs_newEnquiries))
{
$echoStr .= " <tr bgcolor='#ebebeb' class='default'> <td> ".$row_rs_newEnquiries['url']."</td>
}

please advice how i can convert this information that is being displayed into a hyperlink.

thanks.
Jan 16 '08 #1
1 2445
rpnew
188 100+
i need to insert a hyperlink to an sql query. there is a field in the table called url which consists of the url of a page, i would like this information to be displayed as a hyperlink so that i can click on the link.

following is the code =

$sql = " SELECT Count(*) .....";
$rs_newEnquiries = mysql_query($sql, $connEnquiry);

$echoStr = "<table width='80%' cellpadding=1 cellspacing=1 border=0><tr bgcolor='#cccccc;'><th bgcolor='#cccccc' width=10>Count</th><th bgcolor='#cccccc' width=400>Url</th></table>";
while ($row_rs_newEnquiries = mysql_fetch_assoc($rs_newEnquiries))
{
$echoStr .= " <tr bgcolor='#ebebeb' class='default'> <td> ".$row_rs_newEnquiries['url']."</td>
}

please advice how i can convert this information that is being displayed into a hyperlink.

thanks.
Hi,
I think you need to just add <A> tag in your code... like following..
[PHP]
$echoStr .= " <tr bgcolor='#ebebeb' class='default'> <td><A> ".$row_rs_newEnquiries['url']."</A></td>
[/PHP]
Jan 16 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Nel | last post by:
I am trying to write a content management section for a web site. I have managed so far to use htmlarea to give users a basic, but user friendly interface by which to edit the page content. ...
3
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
by: Tina | last post by:
I'm going through a DataGridItem looking to find the text in a hyperlink column. It's not in mydataGridItem.cells(3).text. Where is it? thanks, T
6
by: GaryB | last post by:
Does anyone have any idea how to get the text out of a hyperlink column in a web datagrid? It's a hyperlink column, not a template column so findcontrol does not work and there is no apparent...
19
by: Joe | last post by:
I have an aspx page (referred to here as page_1) with a datagrid whose first column contains hyperlinks. When a user clicks one of these hyperlinks, he will navigate to another aspx page (referred...
1
by: jeguillo | last post by:
I am trying to retrieve the text within each cell in a datagrid in order to change the color of each cell, depending on the value within that cell. This works fine on the cells that are bound...
3
by: Bren | last post by:
Hi All VS2005 Gridview control with vb I am populating a gridview of company staff. One of the columns is a hyperlink to a SMS texting facility I have so secrataries can text the managers...
3
by: avanti | last post by:
HI, I have a HyperLink in my code. It has a OnClick function defined. I am trying to access the text property of the HyperLink in my JavaScript function. ...
4
by: alun65 | last post by:
I'm attempting to programmatically build up some HTML in the code behind. Like so: // Create Hyperlink HyperLink link = new HyperLink(); link.NavigateUrl = "nice cat"; link.Text = "Cats...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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
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...

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.