Gossamer Forum
Home : Products : DBMan : Installation :

If...else in HTML.pl

Quote Reply
If...else in HTML.pl
Can someone have a look at this for me please.

www.jobsinprogress.co.uk/millennium

If you go to the sales section and do a list all you will see that it lists all the areas with a "yes" next to the one that applies.

What I'd like to do is put something in the HTML.pl file that says:

if $rec{'stjohnswood'}="yes" then print "St Johns Wood"

else don't print anything

It's the syntax for this that I'm stuggling with. The only way that I can see to do it is by putting a separate sub in for each area and calling it if the condition is true. I was hoping that there might be a way of putting in the sub html_record without doing that.

Either way, I'm not sure what I need to do.

Any ideas?

Andy
Quote Reply
Re: If...else in HTML.pl In reply to
Since you have installed DBMAN more than once...you should really post requests like this in the Discussion Forum...

Wink

Anyway...You would use the following codes:

Code:
|;
if ($rec{'stjohnswood'} eq "Yes") {
print qq|<$font>St Johns Wood</font>|;
}
print qq|

Regards,

------------------
Eliot Lee....
* Check Resource Center
* Search Forums



[This message has been edited by AnthroRules (edited February 19, 2000).]
Quote Reply
Re: If...else in HTML.pl In reply to
Thanks for that. I've since found out that what I wanted to do won't work anyway. Not without rejigging a lot of the code anyway.

And don't worry, the script will be registered if I can get it working how I want it and the site goes live Smile

Quote Reply
Re: If...else in HTML.pl In reply to
Well, please explain exactly what you want to do and may be we can help you with codes that can address your goal.

Regards,

------------------
Eliot Lee....
* Check Resource Center
* Search Forums

Quote Reply
Re: If...else in HTML.pl In reply to
If what you have works...then go with it. If you come across any bugs, POST THEM IN THE DISCUSSION FORUM, PLEASE.

Regards,

------------------
Eliot Lee....
* Check Resource Center
* Search Forums

Quote Reply
Re: If...else in HTML.pl In reply to
ok, here goes.

The site is for an estate agent. He wants tick boxes so that people can chose several areas when they are doing a search for a house to buy.

I set this up in HTML.pl with all the areas he deals with set up as fields in the cfg file.

When the customer comes to search for a house they tick "St Johns Wood", "Golders Green" and "Hendon". DBMan then looks at house ID number 1 and checks to see if it is in "St Johns Wood", "Golders Green" AND "Hendon". Need I say more?

I would have to set it up so that it did a boolean OR on the "Area" field and a boolean AND on all the other fields.

The long and short of it is that the site is only worth about US$250 to me. I have to pay $100 to Gossamer for the script. Do I want to go through the hassle of redoing all the code when what I have works already.

Andy