Solved

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

Posted on 2010-08-16
2
412 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
scandir() not reads all files 4 25
Wordpress syntax error 1 27
Button Click 11 24
wordpress issue 2 15
Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

708 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

15 Experts available now in Live!

Get 1:1 Help Now