How to Enlarge Image in PHP

Asked By 20 points N/A Posted on -
qa-featured

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?

SHARE
Best Answer by asrafulislam
Best Answer
Best Answer
Answered By 0 points N/A #104282

How to Enlarge Image in PHP

qa-featured

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");

Answered By 95 points N/A #104283

How to Enlarge Image in PHP

qa-featured

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- https://stackoverflow.com/questions/7085640/how-to-enlarge-image-in-php

Answered By 0 points N/A #195582

How to Enlarge Image in PHP

qa-featured

Hi,

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="#">

    </a>

</div>



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%>

Related Questions