No of visitors who read this post: 1223
Category: PHP
Type: Question
Author: Harry viktor
No votes yet

I have a code in PHP where I display a thumbnail image my question is how I can display the Enlarged image in a new tab by clicking the thumbnail image and should be retrieved from database?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

# Comment Id: 57255

How to enlarge the image:

Add the following code:

Else, you can also use the command

imagecopyresample

OR

Imagick::resizeImage

It can both let you resize your image. And also, Magic is not automatically installed on The majority of servers. It certainly depends on collecting option but any of the two is available:

Imagick

or

GD (for imagecopyresample)

To retrieve your image:
If you want to retrieve a jpg file, use the command:

Header ("Content-type: image/JPG");

# Comment Id: 57500

You can easily enlarge image in a new tab by clicking the thumbnail image. In doing this you have to follow the process I given below. With this process you can do without reloading the page and also you don't have to face any pop-ups. Actually it's a one line script to change the image in PHP.

Here are the scripts-
<img src="yourimage.jpg" width="150" height="200" onclick="this. src='yourimage. JPG'; this. height=400; this. width=300" ondblclick="this. src='yourimage. JPG'; this. height=200; this. width=150">
 
** You have to now just pasted this code into the body section of your HTML document.
 
It may work very quickly and your problem will be solved. In another way also you can visit this site- http://stackoverflow.com/questions/7085640/how-to-enlarge-image-in-php