Solved

Hyperlink Recordset Image In PHP. Is there a way to do this?

Posted on 2010-08-16
2
413 Views
Last Modified: 2013-12-13
Is there a way to hyperlink a recordset with an image using php?
I have attached two codes, the second one uses asp code and it works fine.

I have to now use mysql server that uses php. Can I accomplish this using php similar to what I did using ASP?

The first code is php with the field 'datasheet' actually being a hyperlink in my database table.
The field Type in the MYSQL database is 'Char'.
(Example: http://www.escomponents.com)
Thank you...
Rick

<td><?php echo $row_ESCAlternatives['DataSheet']; ?></td>





<a href="<%=(Recordset1.Fields.Item("DataSheet").Value)%>" target="_blank" class="style7"><span class="style6 style1 Forms"><img src = "/images/photoshop/tiny-pdf-page.gif" width="16" height="16" border="0"></span></a>

Open in new window

0
Comment
Question by:ES-Components
2 Comments
 
LVL 11

Accepted Solution

by:
Pieter Jordaan earned 500 total points
ID: 33447204
Hi

Yes you can.



<?php

echo '<td><a href="'.$row_ESCAlternatives['DataSheet'].'" target="_blank" class="style7"><span class="style6 style1 Forms"><img src = "/images/photoshop/tiny-pdf-page.gif" width="16" height="16" border="0"></span></a></td>';

?>

<a href="<%=(Recordset1.Fields.Item("DataSheet").Value)%>" target="_blank" class="style7"><span class="style6 style1 Forms"><img src = "/images/photoshop/tiny-pdf-page.gif" width="16" height="16" border="0"></span></a>

Open in new window

0
 

Author Closing Comment

by:ES-Components
ID: 33447880
Thank you very, very, much!!!!
I am certainly not a PHP expert at all. Took me a few minutes to get your code to work. (Cut/Paste
doesn't always leave the quotes, dahses, etc where they are supposed to be.)

It works perfect!

Thank you for your quick response.
Rick
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now