Running Perl script in the backend from Html

Running Perl script in the backend from Html

am 11.09.2007 07:17:00 von satish2112

Following is my HTML template:



Web page



p>






And the Perl Script script.pl is:

#!/usr/bin/perl
use strict;
use warnings;
use CGI;
use DBI;

my $query = new CGI();
my $Value = $query->param('field');

my $dbh = DBI->connect('server address', 'username','password');
my $sth = $dbh->prepare("UPDATE tablename SET columnname = '$Value'
where condition;");
$sth->execute();
$sth->finish();
$dbh->disconnect;


if i click on the submit button, another webpage is opened and the
perl script is executed.
is there any way so that the perl script runs in the backend? ( so
that another webpage doesnt pop-up). how can i modify the above html
code in order to run the perl script in the backend?

Re: Running Perl script in the backend from Html

am 11.09.2007 08:29:32 von Gunnar Hjalmarsson

satish2112@gmail.com wrote:
> Following is my HTML template:
>
>
>
> Web page
>
>
>


>

> p>
>


>

>
>
>
> And the Perl Script script.pl is:
>
> #!/usr/bin/perl
> use strict;
> use warnings;
> use CGI;
> use DBI;
>
> my $query = new CGI();
> my $Value = $query->param('field');
>
> my $dbh = DBI->connect('server address', 'username','password');
> my $sth = $dbh->prepare("UPDATE tablename SET columnname = '$Value'
> where condition;");
> $sth->execute();
> $sth->finish();
> $dbh->disconnect;
>
>
> if i click on the submit button, another webpage is opened and the
> perl script is executed.
> is there any way so that the perl script runs in the backend? ( so
> that another webpage doesnt pop-up). how can i modify the above html
> code in order to run the perl script in the backend?

print $query->header(-status=>'204 No Content');

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl