473,402 Members | 2,046 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

How to hide images blocks with nothing in them

i have a search results page and i want it to show images from all my pages. so i have added three echos from database
Expand|Select|Wrap|Line Numbers
  1.     <p><img src="images/<?php echo $rsResult['Pic']; ?>" width="250px" height="188px"     <img src="images/<?php echo $rsResult['pictwo']; ?>" width="250px" height="188px"         <img src="images/<?php echo $rsResult['picthree']; ?>" width="250px" height="188px"</p> 
but on some page i only have one image. so on my search results page it shows the firs image but 2 other blank image spots with a image unidentified symbol. is there a code to hide the image blocks if there is no image in them???
Oct 27 '10 #1
2 1560
Death Slaught
1,137 1GB
Not with HTML or CSS alone. Perhaps JavaScript can help you.


Thanks, Death
Oct 28 '10 #2
JKing
1,206 Expert 1GB
Since you are already using php, why not use php to help you.

Not sure what is in your $rsResult but if it is only the images you could put your code in a for loop that loops through your array.

If that's not an option wrap each image block in an if statement and check to see if the source is empty before printing.
Oct 28 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Steve Loft | last post by:
I have a PHP script which generates responses to answers submitted by a form. The responses contain links to images. I'd like to stop users guessing the names of other images and viewing them. I...
0
by: CoreyMas | last post by:
Hello everyone I really have 2 questions, so here goes I have a picturebox, with a Paint event where I modify the image (it's a gif) using e.graphics.DrawLine()..... The line draws...
5
by: Yoramo | last post by:
Hello is it possible to display images on a ASPX without having them on the disk of the server ? I have images in a DB and whould like to display them on a web page. writing them to disk...
8
by: NurAzije | last post by:
Hi, I wonder is there a way or a function to take a high resolution image and change it to low resolution ?? I have a directory with a 200 pictures, and want to save them with the same width and...
9
by: Ben | last post by:
Hi Please Help?! I have created a file which contains some app settings, plus two images. I used the code below to read the contents of the image, then save it with my app settings: ...
1
by: BilWilcox | last post by:
My Question is that I have Images that I need to hide base on the user selection and I'm new to ASP Could some one tell me the easy way there are in table Rows format Thank You Bill
1
by: Doug | last post by:
Hi I have an img control I am trying to hide upon certain types of commands in my code behind. When to hide it is directly tied to a asp:dropdownlist control. So depending on what the user...
3
by: Allllan | last post by:
I am trying to figure out how to show a different image on a report based on the results of a formula. Conditional formatting allows me to change text, but I want to be able to swap out an image...
4
by: rduarte | last post by:
Hello, I'm new to Windows Forms development in C#, and I'm having some trouble with a college project. Simply put, it is a paint-like application, that has a toolbox to draw shapes where the mouse...
0
by: sharoo4000 | last post by:
I have made autorun CD. Which contains jpeg images in same folder where .exe file is present. I want them to hide or want to make presentation in 1 file on AUTORUN CD? Can i do this if yes how?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.