[ic] question about [value ...] , [cgi ....]

Jon interchange-users@icdevgroup.org
Tue Feb 4 23:43:01 2003


> I am trying to get the value of mv_search_file after clicking a
> area search link in category_horizontal. Nothing was added to
> the category_horizontal file but just this:
>
> [value mv_category_horizontal] <--- didn't work.
>
> then I went throught the milling list and found something about
> [cgi ..] so i added this
>
> [cgi mv_category_horizontal] <---- didn't work.
> [cgi fi] <--- event tried that.. didn't work.
>
> then I went to the milling list again ..
> and this time
> [perl]
> my $name = $CGI->{fi}
> return $name
> [/perl]          <---- didn't work.
>
> I am trying to keep track of which product cat (area) the user
> is on and print out something base on that. Thanks for any help!

    This may or may not be what you're looking for. I was fortunate
enough
to get this from Jeff at shop.sophee.com, I hope he doesn't mind me
reposting it, and I would send you to the archives but the thread
doesn't
appear to be there yet.  In any case this will grab the info from the
user's
click on something in category_vertical.  If this isn't what you're
looking
for then maybe ask again.

Jon



[if session last_search =~ /products/]
   [seti lastsearch][data session last_search][/seti]
   [perl]
     my @sf;
     my @se;
     my $item;
     my $cnt = 0;
     my $tmpSearch = {};
     my @searchstring = split(/\//,$Scratch->{lastsearch});
     ## build list of sf and se
     foreach $item (@searchstring) {
       if ($item =~ /^sf=(.*)/) {
         push @sf,$1;
       }
       elsif ($item =~ /^se=(.*)/) {
         push @se,$1;
       }
     }
     ## now build our hash of field/term pairs
     foreach $item (@sf) {
       $tmpSearch->{$item} = $se[$cnt];
       $cnt++;
     }
     ## populate needed scratch values
     $Scratch->{lastbrand} = $tmpSearch->{brand};
     $Scratch->{lastmaincat} = $tmpSearch->{maincat};
     $Scratch->{lastsubcat} = $tmpSearch->{subcat};
     return;
   [/perl]
 [/if]