上传和显示图像 [英] upload and display images
问题描述
i经历了一个关于如何显示存储在目录中的图像的教程,它出来很好,但我有一个问题.....当我上传少于5个文件显示1个图像,然后显示损坏的图像占位符。如果我不上传5个总和,那么这些破碎的图像位置持有者会继续显示,而不是逐行显示的图像,它按行列出。
下面是代码显示....有人可以告诉我我哪里出错了或者我怎么能改变它所以它以5行显示上传的图像?
Hi,
i went through a tutorial on how to display images stored with a directory and it came out good but i have a problem.....when i upload less than 5 files it displays the 1 image and then shows broken image placeholders. If i don''t upload in sums of 5 then these broken image places holders keep showing, and instead of the images displaying row by row it goes by columns.
Below is the code to display....can someone tell me where i''ve gone wrong or how i can change this so it displays the uploaded images in rows of 5?
推荐答案
看了一眼我发现代码中有两个问题。
第一个是
After looking at a glance I found two problem in your code.
First one is
它帮助了一些...... ..它显示图像完全正常,并没有显示破碎的占位符,但它显示在1列....我试图让它以每行最多5个图像的行显示
it helped some what....it shows the images perfectly fine and doesn''t show the broken placeholder but it is displaying in 1 column....i am trying to get it to show in rows at max of 5 images per row
< br>
@ anfetienne
你的显示逻辑对我来说不是很清楚。你可以把虚拟输出HTML代码放在两个案例中,如3个图像和7个图像。一旦我看到HTML代码,我可能会尝试帮助您编写php代码。
@anfetienne
Your display logic is not very clear to me. Can you put the dummy output HTML code for two cases like 3 images and 7 images. Once I see the HTML code I may try to help you with the php coding.
这篇关于上传和显示图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!