[ic] [if][elsif] question

Ed LaFrance edl at newmediaems.com
Sun Jul 6 14:16:03 EDT 2003


At 02:50 PM 7/6/2003 -0400, you wrote:
>I have a search page with a drop down that allows users to search 
>different pages (eg search my site, my friends site, or google).  I have 
>this form element named 'site'.  I am trying to do something like this for 
>the results page:
>
>[if cgi site eq "my friends site"]
>  [then]
>    [bounce href="http://friends-site.com/search/?query=[cgi mv_searchspec]"]
>  [/then]
>[/if]
>[if cgi db eq "google"]
>  [then]
>    [bounce href="http://www.google.com/?query=[cgi mv_searchspec]"]
>  [/then]
>[/if]
>
>This works fine, however I would rather use an if elsif type form.  But 
>when I change the second if to an elsif, it seems to default to google 
>unless my friends site is specified, such as it is saying else, but not 
>checking the if. Is this correct?  Or am I doing something wrong?
>
>Thanks.

Dunno if you are doing anything wrong with your alternative code, since you 
did not post it! Perhaps there is a syntax error. Something like this 
should work:

[if cgi site eq "my friends site"]
    [bounce href="http://friends-site.com/search/?query=[cgi mv_searchspec]"]
[elsif cgi db eq "google"]
    [bounce href="http://www.google.com/?query=[cgi mv_searchspec]"]
[/elsif]
[else]
         (put the 'default' thing here, it will show if
         the other two conditions are not met)
[/else]
[/if]

- Ed

===============================================================
New Media E.M.S.              Technology Solutions for Business
463 Main St., Suite D         eCommerce | Consulting | Hosting
Placerville, CA  95667        edl at newmediaems.com
(530) 622-9421                http://www.newmediaems.com
(866) 519-4680 Toll-Free      (530) 622-9426 Fax
=============================================================== 



More information about the interchange-users mailing list