[ic] Passing Arguments in URL

Kevin Walsh kevin at cursor.biz
Tue Mar 16 17:58:57 EST 2004


Himem Inc [interchange at himem.net] wrote:
> I currently have this code:
> 
> somepage.html
> <a href="[area contact_us show]">click here</a>
> 
> contact_us.html
> [cgi mv_arg]
> [if explicit]
> [condition]
>   $show = '[cgi mv_arg]';
>   return 1 if $show =~ /show/;
>   return 0;
> [/condition]
> one
> [else]
> two
> [/else]
> [/if]
> 
> The result is:
> somepage.html creates a link:
> mysite/cgi-bin/site/contact_us.html?mv_arg=show
> 
> When I click this link, contact_us.html says;
> show two
> 
> The 'show' is being produced by the [cgi mv_arg] and the two is from the
> if failing. 
> 
You could use this:

    [if explicit]
    [condition]
        my $show = $CGI->{mv_arg};
        return 1 if $show =~ /show/;
        return 0;
    [/condition]
        one
    [else]
        two
    [/else]
    [/if]

or this:

    [if explicit]
    [condition]
        $Session->{arg} =~ /show/;
    [/condition]
        one
    [else]
        two
    [/else]
    [/if]

or perhaps this:

    [if type="explicit" compare=`$Session->{arg} =~ /show/`]
        one
    [else]
        two
    [/else]
    [/if]

or even this:

    [if session arg =~ /show/]
        one
    [else]
        two
    [/else]
    [/if]

not forgetting this:

    [calcn] $Session->{arg} =~ /show/ ? 'one' : 'two' [/calcn]


There's more than one way to do it.

-- 
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin at cursor.biz
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/



More information about the interchange-users mailing list