Image from database not appearing in same dimension as without database - php

I am making an e-commerce website in php with mysql database, I am using a web template for front-end, the issue is when I try to upload the image from database, it is not showing in proper dimension, however when i upload the same image without database it works and shows in proper size as defined in template. I don't know why is this happening because there are same css and same image class define for both.
Here is the screenshot of image in without database:
And below with fetching from database:
I am stuck how to make image display same as without database.

Simply add width and height to the image at front end and only retrieve image in src tag
This can fix your problem
& if it didn't fix please provide your code snap

Related

change position of image in image gallery using php

Hi i am working on a photo gallery. Here all images are coming from mysql database table. The images are uploaded from the admin panel. I am using php to upload and fetch images from database table. Till here all things are working fine. Now i have to implement a system where user should be able to define the position of the image in the image gallery and image positions should be swiped with one another image. In the gallery page I am showing 16 images in four rows and after that pagination starts. So will it be possible to implement such a system in my image gallery?
If I understand what you want to do correctly then you might want to check out this jQuery plugin: http://isotope.metafizzy.co/

How to get the image in summernote bootstrap using php

I am using a summernote in bootstrap as my editor. It looks good and I'm fond using it. I can get the texts inserted by the user, however, the problem is that when the user inserted an image, the src of image returns to a binary text. I dont want to save this whole text of the src into the database, instead, I want the image to be saved directly to my disk drive and copy the image name and save it into the database.
Does anybody know this?

TCPDF Image doesnt show off normal

Im working on a PDF. I just wanted to change the logos so I changed the Image and on the first site I get the new image in correct size so but in the second pdf the image is very large.....
Here the line : $this->Image('images/logo.jpg', 160,12.0,30 );
I find it screws up if I used the same image twice. Best practise is to use an image only one time in a PDF. Make a copy of it under a different name if you are going to use it again.

Can I un-cache one image? Or should I do things differently?

I allow users to add a profile picture of themselves to an account, pretty standard stuff.
To make things simple, when they update their image I simply overwrite the image they currently have stored (its not a big part of what we do so simple approach)
So, page is shown with their current image, they can then choose to upload a new one, the uploaded file is then saved, image URL updated in MySQL table and page is displayed again.
The image is uploaded correctly, MySQL table updated correctly, but the image is cached so old image shows on page even though they have uploaded a new one.
Can I un cache one image? Is there a better way to do this?
For avoiding image caching you can simply add a query sting in the image src. Best would be adding a date time.
{$t = getDate();}
and in your image src add: src= "path.jpg?t=".$t
For this you need not to change anything for new image..Date time automatically gets changed every second ;)
Hope it helps..
Use versioning. In the link for the image, instead of abc.jpg say abc.jpg?v=5. And when a new image is uploaded, change the number.
see this question

show uploaded files in gridview using php

i uploaded files into my server image folder.
after upload want to display the uploaded files as thumbnails in the grid view or anything(like windows explorer), also want to select multi files from grid view and download it.. any help to be appreciated.. im using php...
thank you so much...
Here some pointers to get you started:
Loop through the images and simply output them all, then use some CSS padding and width setting to get them into a grid. Alternatively, output them in a table, inserting a </tr><tr> every n loop iterations.
Add a checkbox input using some uniquely identifying value to each image to make it "selectable".
Use some Javascript to spice up the selection process and make it more "Explorer-like".
Try it and come back with more specific questions as you encounter them (after trying to solve them yourself first).
I think you need a PHP Photo Gallery instead. There is an awesome gallery Plogger that you can use.
Otherwise, here are more PHP galleries.
That would be a rather large project to undertake. Try a premade package like:
http://www.gerd-tentler.de/tools/filemanager/ (simple and free)
or
http://www.filerun.com/ (looks good, but requires license)
with the help of <table><tr><td>... you can make a grid view and with using the php code collect all uploaded files into an array then show the file in the grid view by inserting php code in between. In that you can give check boxes and place php code in between to generate an array while user cliks each check box correspondin to that file a link should be passed to the array and then post the values on the download button clik, in the next step you can use the php zip function to ip these file in the array and send it to user as download link

Categories