#!/usr/bin/perl # Title Processor.pl use CGI; use DBI; my $cgi = CGI->new; my $local = $cgi->param("POSTDATA"); print $cgi->header(-type => "application/json", -charset => "utf-8"); print "$local was received"; my $username = "test"; my $password = "test"; my $dsn = "dbi:mysql:detailsof:127.0.0.1"; my $dbh = DBI->connect($dsn,$username,$password,{RaiseError => 1,PrintError => 0}) or die "cannot connect to database : $DBI::errstr"; my $sth = $dbh->prepare(qq{INSERT INTO cust_details.c_details(f_name,l_name,dob_email) VALUES ('$customer->{first_name}->[0]','$customer->{last_name}->[0]','$customer->{dob}->[0]','$customer->{email}->[0]')}); $sth->execute() || die $DBI::errstr; $sth->finish(); $dbh->disconnect;