#!/usr/bin/perl use DBD::mysql; use DBI; require '_templates/db.pl'; require '_templates/common.pl'; require '_templates/news.pl'; require '_templates/review.pl'; require '_scripts/funlib.pl'; require '_scripts/parsquery.pl'; parse_query(); require '_scripts/parsform.pl'; parse_form(); $dbh = DBI->connect("DBI:mysql:database=$db_name;", $db_user, $db_password) or die "Cannot connect to db!"; $reviewid = $QUERY{'ID'}; get_review($reviewid); $action = $FORM{'Action'}; if ($action eq 'rate') { $rating = $FORM{'rate'}; if ($rating >=1 && $rating <= 10) { $qry = "insert into reviewrating (c_review, rating) values (?, ?)"; $sth = $dbh->prepare($qry); $rv = $sth->execute($QUERY{'ID'}, $rating); } } print 'Content-type:text/html '; print " COMPOSTER: Статьи: \"$caption\""; print ' '; print_logo(); print_menu(); print_head(); print '
'; print_review($reviewid); print ' '; print_announcements(1); print_copyright(0); print '
'; print '