Jump to content

php mysql display image as web link


duxbuz

Recommended Posts

Hi,

 

Am looking for help with displaying image in webpage, that is also a http link.

 

I managed to display the images with a 2 script thing like this:-

 <?php 
		while($row = mysql_fetch_array($result))
			{
		?>
            
           <p class="style2"><img src="getyeargrps.php?fileId=<?php echo $row["id"]; ?>" alt="" /></p>
              <p class="style2"> </p><?php }; ?>

 

which calls a seperate file that handles the mime part. But i wanted to display another ROW like $rol["link"] with the link details in like:

<a href="downloadfile.php?fileId=<?php echo $row["id"]; ?>"

But didint want to need another seperate file.

 

Seems the mime thig is a problem. Hope people can follow this poor explanation. This text box is awful to type in it wont scroll down.

Link to comment
https://forums.phpfreaks.com/topic/189154-php-mysql-display-image-as-web-link/
Share on other sites

Why dont you just use the same file for downloading and outputting..

If you want to download just add another GET var to your URL like download=true

if that is set it can start the downloading process if its not set it displays it for img tags.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.