CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Pictures - a test before showing

Print topic Send  topic

Author Message
Bernd
Posted: 04/27/2004, 1:26 PM

Hi all,

I need to come up with the following solution..

Before a page is displayed it needs to see if a certain picture does indeed exist. If not it must display the defaul "Not availeble" picture and if it does, it should show the picture.

Any Ideas on how I can do this ?

Thanks
RonB

Posts: 228
Posted: 04/28/2004, 11:44 AM

I take it thew file name for the picture is in the database.
if($gridname->labelname->getvalue() =="")
{
$gridname->labelname->setvalue("<img src='./notavailable.jpg' >");
}else $gridname->labelname->setvalue("<img src=' " . $gridname->labelname->getvalue() ."' >");
View profile  Send private message
berndh

Posts: 10
Posted: 05/01/2004, 3:06 PM

Hi,

The picture code is generated in the admin section once the submit button is pressed by the following code:

'Custom Code @44-73254650
' -------------------------
if not IsNull(adminbook.isbn.Value) then
adminbook.picture.Value = "../images/books/" & adminbook.isbn.Value & ".jpg"
end if
' -------------------------
'End Custom Code

This is a the same as the isbn number with a .jpg extension. Now I just need to figure out how to test if that image actually is in the images folder so the web users do not see the little squre of the missing picture. And if it does not exist it should show a picture called "na.jpg"

Thanks
Bernd
View profile  Send private message
peterr


Posts: 5971
Posted: 05/02/2004, 4:03 PM

http://www.google.com/search?q=check+if+file+exists+php
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.