Solved

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

Posted on 2010-08-16
2
416 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

739 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