/[nn.old]/trunk/search/nn-search.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/search/nn-search.cgi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 15 - (hide annotations)
Tue Jan 22 12:06:27 2002 UTC (22 years, 3 months ago) by dpavlin
File MIME type: application/octet-stream
File size: 1053 byte(s)
Initial revision

1 dpavlin 15 #!/usr/bin/perl -w
2    
3     use strict;
4     use CGI qw/:standard -no_xhtml/;
5     use DBI;
6    
7     my $url="http://www.nn.hr/CijeliBrojS.asp?god=%d&br=%d#%d";
8    
9     my %labels = (''=>'naslovu', '_czs'=>'naslovu bez naših slova');
10    
11     print header(-charset=>'iso-8859-2'),start_html(-title=>'NN pretrazivanje',-lang=>'hr'),start_form;
12     print "Traži u ",popup_menu(-name=>'naslov_add',-values=>[ keys %labels ],-labels=>\%labels);
13     print textfield('search'),submit;
14     print end_form,hr;
15    
16     if (param('search')) {
17     my $dbh = DBI->connect("DBI:Pg:dbname=nn","dpavlin","") || die $DBI::errstr;
18     my $sql="select br,god,aname,nr,title from nn where title".param('naslov_add')." like '%".param('search')."%'";
19     my $sth=$dbh->prepare($sql) || die $dbh->errstr();
20     # $sth->execute(param('search')) || die $dbh->errstr();
21     $sth->execute() || die $dbh->errstr();
22     #print "<pre>$sql</pre>";
23     while (my $row = $sth->fetchrow_hashref()) {
24     print br,"<tt><a href=\"",sprintf($url,$row->{god},$row->{br},$row->{aname}),"\">NN",$row->{god},"/",$row->{br},"</a> ",$row->{nr},"</tt> ",$row->{title},"\n";
25     }
26     }
27    

Properties

Name Value
cvs2svn:cvs-rev 1.1
svn:executable *
svn:mime-type application/octet-stream

  ViewVC Help
Powered by ViewVC 1.1.26