blob: 13ed058bfd8f961ad3137ad9d6f174f96d9760cc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#! /usr/bin/perl
use CGI qw(fatalsToBrowser);
use DBI;
use lib '../../include';
use utf8;
use nms;
use strict;
use warnings;
use Data::Dumper;
my $cgi = CGI->new;
my $dbh = nms::db_connect();
my $id = $dbh->quote($cgi->param('comment') || die );
my $state= $dbh->quote($cgi->param('state') || die);
my $q = $dbh->prepare("UPDATE switch_comments SET state = " . $state . " WHERE id = " . $id . ";");
$q->execute();
print $cgi->header(-type=>'text/json; charset=utf-8');
print "{ 'state': 'ok' }";
|