How to Enlarge Image in PHP
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?
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?
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");
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
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%>