#!/usr/bin/perl use warnings FATAL => 'all'; use CGI; use CGI::Carp qw(fatalsToBrowser); use DBI; use DBD::mysql; my $cgi = CGI->new; print $cgi->header, $cgi->start_html; my $title = $cgi->param('TITLE'); my $feature = $cgi->param('FEATURE'); my $type = $cgi->param('TYPE'); my $description = $cgi->param('DESCRIPTION'); my $status = $cgi->param('STATUS'); my $path = $cgi->param('PATH'); my $priority = $cgi->param('priority'); my $database = "test_case"; my $host = "localhost"; my $user = "chiragk"; my $pw = ""; my $dsn = "dbi:mysql:$database:localhost"; my $dbh = DBI->connect($dsn, $user, $pw, { RaiseError => 1 }) or die "unable to connect:$DBI::errstr\n"; my $query = "insert into test(title,feature_name,type,description,status,test_case_path,priority) values(?,?,?,?,?,?,?,)"; my $sth = $dbh->prepare($query); $sth->execute("$title","$feature","$type","$description","$status","$path","$priority"); print $cgi->p("[$title],[$feature],[$type],[$description],[$status],[$path],[$priority]"); print $cgi->end_html;