Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Running Perl script in the backend from Html

1 view
Skip to first unread message

satis...@gmail.com

unread,
Sep 11, 2007, 1:17:00 AM9/11/07
to
Following is my HTML template:

<html>
<head>
<title>Web page</title>
</head>
<body>
<form method="post" action="script.pl">
<p><textarea cols="20" rows="20" name="field"></textarea></
p>
<p><input type="submit" value="update" ></p>
</form>
</body>
</html>

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?

Gunnar Hjalmarsson

unread,
Sep 11, 2007, 2:29:32 AM9/11/07
to

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

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

satis...@gmail.com

unread,
Sep 12, 2007, 11:51:30 PM9/12/07
to
following is my Html code:

<form name="form100" method="post" action="script.pl">
<textarea cols = "160" rows="12" name="TextArea1" > </textarea>
<input align = "left" name="UpdateButton" type= "submit"
value="Update" >

in the above code, if i click on submit button, a webpage is opened
and the script in script.pl is executed.

is there any way such that another web-page is not opened and the
script is run in the backend?

Please help me!!

Petr Vileta

unread,
Sep 13, 2007, 2:11:05 AM9/13/07
to
For what purpose you need it? Maybe I can help you when I will know the
purpose.
--

Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail
from another non-spammer site please.)

Gunnar Hjalmarsson

unread,
Sep 13, 2007, 5:00:30 PM9/13/07
to

I tried...

http://groups.google.com/group/comp.lang.perl.misc/msg/7ef1507bf9b74338

Why do you ignore the reply you got so far??

Ken

unread,
Sep 17, 2007, 4:23:20 PM9/17/07
to
You could also use ajax to do the submit.
0 new messages