/[nn]/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

Contents of /search/nn-search.cgi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1.1.1 - (show annotations) (vendor branch)
Tue Jan 22 12:06:28 2002 UTC (22 years, 2 months ago) by dpavlin
Branch: dbp, MAIN
CVS Tags: r0, HEAD
Changes since 1.1: +0 -0 lines
initial import

1 #!/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

  ViewVC Help
Powered by ViewVC 1.1.26