how to not print to html file a feild that has no value from

 
Post new topic   Reply to topic    Aprelium Forum Index -> Perl
View previous topic :: View next topic  
Author Message
cagozoe
-


Joined: 24 Apr 2005
Posts: 23

PostPosted: Thu Nov 24, 2005 4:44 am    Post subject: how to not print to html file a feild that has no value from Reply with quote

I have the following in perl script

what i need it to do is if no information is placed in the feild then don't print to html file.

print PAGE "<font size=\"4\">PRODUCT - $FORM{'productone'}</font>\n";
print PAGE "<font size=\"4\">Amount - $FORM{'productoneamount'} \n";

print PAGE "<font size=\"4\">PRODUCT - $FORM{'producttwo'}\n";
print PAGE "<font size=\"4\">Amount - $FORM{'producttwoamount'}

if no amount is typed into the form i dont need the PRODUCT or AMOUNT to print on html output file.

have a look
http://www.cvb.dns2go.com/truck/ffa-december.html

use the add to place information.

how can i have it NOT print feilds that have no value placed in the form?
Back to top View user's profile Send private message Visit poster's website
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Thu Nov 24, 2005 12:30 pm    Post subject: Re: how to not print to html file a feild that has no value Reply with quote

cagozoe,

Use the conditional test keyword if:

Code:

if ($FORM{'productone'}) {
    print PAGE "<font size=\"4\">PRODUCT - $FORM{'productone'}</font>\n";
}

_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
cagozoe
-


Joined: 24 Apr 2005
Posts: 23

PostPosted: Thu Nov 24, 2005 12:54 pm    Post subject: thanks! Reply with quote

Thanks
Back to top View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> Perl All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group