This topic is locked

Database Image Link

6/30/2006 2:53:35 PM
PHPRunner General questions
B
bbanks author

I have images stored in a database and I need the Image to be a hyperlink on the list page. I can't change it to a file based image it has to be in the database. Has anyone fiqured this out?

Alexey admin 7/3/2006

Bart,
you can modify generated List page for this.

Find this snippet in ..._list.php file:

<img ... src="..._imager.php?<?php echo $iquery;?>">



and modify it to meet your need.

B
bbanks author 7/5/2006

Ok, I guess I don't know what I'm doing and would greatly appreciate your help with this.
I found the code, it looks like this:
<img border=0 src="tblOnlineDealersRand_imager.php?<?php echo $iquery;?>">

Now, I need to link it to the data in the"link" field in the table.
In every record in the table "Image" field is a logo the "link" field is a website url. when you click the image it should open a new browser window and go to the website.
Can you help?
Thanks in advance

Bart,

you can modify generated List page for this.

Find this snippet in ..._list.php file:
and modify it to meet your need.

J
Jane 7/6/2006

Bart,
here is a sample code:

<a href="http://YourURL.com"; target=_blank>

<img border=0 src="tblOnlineDealersRand_imager.php?<?php echo $iquery;?>">

</a>

B
bbanks author 7/6/2006

That's great it works! Thank you so much for your help.
Now the only thing left is to get the http://YourURL.com to actually come from the field "link"
do you know how to do that?

Bart,

here is a sample code:

Alexey admin 7/7/2006

Bart,
here is the code you need:

<a href="<?php echo $data["link"];?>" target=_blank>

<img border=0 src="tblOnlineDealersRand_imager.php?<?php echo $iquery;?>">

</a>

B
bbanks author 7/7/2006

YOU ARE A GENIUS!!!
That worked perfectly. I can't thank you enough.

Bart,

here is the code you need: