diff options
Diffstat (limited to 'web/nms.gathering.org/comment-change.pl')
-rwxr-xr-x | web/nms.gathering.org/comment-change.pl | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/web/nms.gathering.org/comment-change.pl b/web/nms.gathering.org/comment-change.pl new file mode 100755 index 0000000..13ed058 --- /dev/null +++ b/web/nms.gathering.org/comment-change.pl @@ -0,0 +1,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' }"; + |