No of visitors who read this post: 2746
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




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:



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-

# Comment Id: 166238


Y ou can easily chane size of image in a new tab by clicking the thumbnail image

Add this code to you page to enlarge your image when clicking on it.

Create file name "dispimage.php

<div class="item">

    <a href="image.php">

        <img src="image5.jpg" attributes="#"\>



By clicking on images it will open new new named “image.php”;

Create file name "image.php

Type this code in that.

<img src="image5.jpg" height=70% width=70%>