Forums

This topic is locked

Image velue - please help

Posted 20 years ago
1
has voted
20 years ago Mashkur Alam posted:
Hi
I am currently working in a estate agency and developing their website. I have a big problem to resolve image problem. Like, sometimes image are not available, then i want to point out from MX that if image value is 0 then show default image, How can I do this? Please any friend help me with this. Will be great.

Babu

Replies

Replied 20 years ago
20 years ago Lee Diggins replied:
Hi Babui

For this to work nicely, you should have a field in your database that stores the image name for a property. What you'll need to do is write an 'if' statement somewhere, that checks for the value of the image name field and if found to be empty or not an image name then display the default image.

You need to let us know what web server and server-side language you are using so someone can show you an example, also post your page code.

Digga

Sharing Knowledge Saves Valuable Time!!!
Replied 20 years ago
20 years ago Mashkur Alam replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Hi Babui

For this to work nicely, you should have a field in your database that stores the image name for a property. What you'll need to do is write an 'if' statement somewhere, that checks for the value of the image name field and if found to be empty or not an image name then display the default image.

You need to let us know what web server and server-side language you are using so someone can show you an example, also post your page code.

Digga

Sharing Knowledge Saves Valuable Time!!!
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Thanks a lot for your help.
Currently I am using DWMX with ASP/VBSCRIPT and Access 2000 Database.
I have a image name property where the image paths are stored which brings the specific image for that property. If there is no image then there is no path for that, so at that time shall I call the default image??? Please, tell me a bit more in here. I will be realy helpfull. Or shall I make another culumn in the database with value 0 or 1??? In here I am quite confuse. Look forward from you.
Thanks again

Babu

Edited by - babui on 21 Sep 2004 15:50:25

Edited by - babui on 21 Sep 2004 15:55:48
Replied 20 years ago
20 years ago Lee Diggins replied:
Hi Babu

something like this:

&lt;%
If rsMyImageFileName.Fields.Item("myImageName".Value = "" Then

Response.Write("myDefaultImageName.jpg"

Else

rsMyImageFileName.Fields.Item("myImageName".Value

End If
%&gt;

If you db holds nulls for the value of the image file name, then to do a null check do this:

&lt;% If IsNull(rsMyImageFileName.Fields.Item("myImageName".Value) Then %&gt;

Digga

Sharing Knowledge Saves Valuable Time!!!

Reply to this topic