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() ."' >");
|
|
|
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
|
|
|
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 |
|
|