/[mws]/trunk/html/index.cgi
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /trunk/html/index.cgi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4 - (hide annotations)
Tue May 4 15:47:14 2004 UTC (20 years, 1 month ago) by dpavlin
File size: 702 byte(s)
added CGI interface (slow), global configuration, templates

1 dpavlin 4 #!/usr/bin/perl -w
2    
3     use strict;
4     use CGI qw/:standard -no_xhtml/;
5     use CGI::Carp qw(fatalsToBrowser);
6     use Template;
7     use lib '../';
8     use MWS;
9    
10     use Data::Dumper;
11    
12     print header(-charset=>'iso-8859-2');
13     print start_html(-title=>'Mail::Box Web Search'),start_form;
14     print textfield('search');
15     print submit(-value=>'Find!');
16     print end_form,hr;
17    
18     my $s=param('search');
19    
20     if ($s) {
21    
22     my $mws = MWS->new('../global.conf');
23    
24     my $results = $mws->search($s);
25     print "$results results...\n";
26    
27     my $t = Template->new({
28     INCLUDE_PATH => $mws->{config}->val('global', 'templates'),
29     });
30    
31     my @res = $mws->fetch_all_results();
32    
33     $t->process("results.html", {
34     query => $s,
35     results => \@res,
36     }) || die $t->error();
37    
38     }
39    

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26