Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to hyper link a field

Status
Not open for further replies.

murushanmugham

IS-IT--Management
Jan 2, 2003
33
0
0
Hello
I have a coding like this
I display the contents of the 4 fields in the table. These should be hyperlinked to open a another file abc.pdf.
I store the pdf filename in another field ie row[15].
How do i hyperlink this.

</TD>
<TD><FONT COLOR=WHITE><B><?print $row[5]?><br><FONT COLOR=WHITE>
<?;print $row[6];?></FONT><br><FONT COLOR=WHITE> <?print $row[7]; ?></FONT><br><FONT COLOR=WHITE><?print $row[8];?></FONT> <a href=<? print "$row[15]"; ?>>

</TD>

The routine is to search for a topic from the title and display the relevant pdf file.

Please help
 
Hard to say from such an obscure code you sent us. You just contruct a link like any other with the information you have. Cleaning up your html code would be a nice thing to do as well. If you want to print link from what you have:
Code:
<a href="<? print $row[15]; ?>"><? print $row[15]; ?></a>
This will make a link out of the URI you provided (according to what you told us.

Here's what I would do with the code I see:
Code:
echo '<td style="color: white; font-weight: bold;">' . $row[5] . '<br />' . $row[6] . '<br />' . $row[7] . '<br />' . $row[8] . '<a href="' . $row[15] . '">' . $row[15] . '</a></td>';
 
I want the contents in row5, row6, row7 and row8 to be hyper linked with row15
This is how it is

row5= PHARMACOLOGICAL
row6= ANTI-CANDIDAL AND CYTOTOXIC ACTIVITY OF PETROLEUM row7= EETHER LEAF EXTRACT OF OXYSTELMA ESCULENTUM
row8= PHARMA

I want to the above to be hyperlinked with the filename which i have stored in row14
 
How about:
Code:
echo '<td style="color: white; font-weight: bold;"><a href="' . $row[15] . '">' . $row[5] . '<br />' . $row[6] . '<br />' . $row[7] . '<br />' . $row[8] . '</a></td>';
This is all very basic stuff of just outputting what you want. From this example you should know what to put where if you need anything else.
 
I dont know if this is relevant or not, but I made this very cool script..

It's based on a "smiley script", which I made a long time ago.

Basically, what it does, is that it builds up an array of keywords. It then replaces occurrances of keywords within content, with link to related pages.

I just think that a system like that, might be cool for your situation?

eg. Each page has a keyword, if content has keyword, replace keyword with link to page with keyword.

I think it took me 20 minutes to program..
(including db design and test-data input)

Olav Alexander Mjelde
Admin & Webmaster
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top