Gossamer Forum
Home : Products : DBMan : Customization :

IF "Value" Show Picture

Quote Reply
IF "Value" Show Picture
I am having problems. i need to have a output command that if my check box is check which the value is Yes how would be able to have the output show a Sold picture if this certain item has been sold (checked)

i have it as a checkbox command in the input, and the reason i am also doing this is, because if the value is no it would should the button to be able to buy the item.

Thanks

Jose Simonelli
Quote Reply
Re: [TKEP1008] IF "Value" Show Picture In reply to
You could simply use this whereever you want it displayed as an example:

|;
if ($rec{'Sold'} eq "Yes") {
print qq| $sold_gif |;
}
print qq|

I do this and then define the variable for the graphic within my .cfg file

$sold_gif = '<IMG SRC="../../img/itemsold.gif" ALT="[ Item Sold ]" WIDTH=16 HEIGHT=16 BORDER=0 ALIGN=absmiddle>';

Hope this helps

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] IF "Value" Show Picture In reply to
i tried the way you showed me but nothing happened, no errors, and defenetly no Sold picture.

so i even tried

|;
if ($rec{'Sold'} eq "Yes") {
print qq| $sold_gif |;
}
print qq|
else ($rec{'Sold'} eq "No"){
print qq|
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="jsimonelli\@artyko.com">
<input type="hidden" name="item_name" value="$rec{'Title'}">
<input type="hidden" name="amount" value="$rec{'Price'}">
<input type="hidden" name="return" value="http://simonelli.artyko.com">
<input type="hidden" name="cancel_return" value="http://simonelli.artyko.com">
<input type="image" src="https://www.paypal.com/images/sc-but-03.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<input type="hidden" name="add" value="1">
</form>
|;
}
print qq|



and this one game me an error.

What should i do. i just need that if a painting is sold it dispalyas a Sold graphic instead of the paypal payment button



thanks

Jose
Quote Reply
Re: [TKEP1008] IF "Value" Show Picture In reply to
The reason for the error in your second example is the stray print qq| just before the } else

This:

else ($rec{'Sold'} eq "No"){

Needs to be:

elsif ($rec{'Sold'} eq "No"){

too.

Or

} else {

Last edited by:

Paul: Jun 19, 2002, 1:19 PM
Quote Reply
Re: [Paul] IF "Value" Show Picture In reply to
well i tried that

|;
if ($rec{'Sold'} eq "Yes") {
print qq| $sold_gif |;
}
elsif ($rec{'Sold'} eq "No"){
print qq|
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="jsimonelli\@artyko.com">
<input type="hidden" name="item_name" value="$rec{'Title'}">
<input type="hidden" name="amount" value="$rec{'Price'}">
<input type="hidden" name="return" value="http://simonelli.artyko.com">
<input type="hidden" name="cancel_return" value="http://simonelli.artyko.com">
<input type="image" src="https://www.paypal.com/images/sc-but-03.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<input type="hidden" name="add" value="1">
</form>
|;
}
print qq|



and now it doesnt even show wether its Sold or show the Add to cart picture. I dont know whats going on. and when i pull up the source from the page, it doesnt show any code for either of them.



Please help

Thanks

Jose Simonelli
Quote Reply
Re: [TKEP1008] IF "Value" Show Picture In reply to
That probably means $rec{Sold} is undefined. Try printing it.

Using if/else instead of if/elsif will solve that.