sub upd_server_type_filter {
- Setting cookies & redirection
my $server_type_filter = $cgi->param('server_type_filter_text_area');
# a clunky solution for a clunky framework
print "<meta http-equiv=\"Set-Cookie\" content=\"server_type_filter=$server_type_filter; path=/; expires=\"\"\">\n";
print "<meta http-equiv=\"refresh\" content=\"0\">\n";
}
- Getting the cookie
sub get_server_type_filter {
my @filter;
# fetch cookies
my %cookies = CGI::Cookie->fetch;
my $server_type_filter = $cookies{'server_type_filter'}->value if $cookies{'server_type_filter'};
$server_type_filter =~ s/\s//g;
@filter = split /,/, $server_type_filter;
return @filter;
}
No comments:
Post a Comment