Thanks for the respones.
Yes I mean lexical .
I tried running httpd -X, and then it happens immediately ie: the second time I submit the form it has the values from the first time.
Here is the code.
use strict vars;
use CGI qw(param);
use diagnostics ;
# Constants
my $db = "ecreditdb";
my $server = "localhost";
my $user = "updater";
my $password = "1q2w3e4r";
# CGI Parameters
my $Id = param("ID");
my $Fname = param("Fname");
sub init {
# Connect to database
my $dbh = '';
$dbh = DBI->connect("DBI:mysql:$db:$server", $user,$password);
if (! $dbh) {
print "Could not connect to $db on $server\n";
}
$dbh->{RaiseError} = 1;
# Prepare and run the query
my $query="INSERT INTO clients values( \"$Fname\",\"$Id\") ;";
my $sth = $dbh->prepare_cached("$query") or die "Can't prepare stateme
+nt: $dbh->errstr \n";
$sth->execute or die "Can't execute statement", $dbh->errstr ;
$sth->finish;
$dbh->disconnect();
disp();
} # End
sub disp {
print "
<html>
<head>
<title>Update completed successfully</title>
</head>
<body bgcolor=\"#CCCCCC\">
<p align=\"center\"><font face=\"Courier New\" size=\"4\"><b><br>
<font color=\"#000000\">Update completed successfully</font></b></font
+></p>
<p align=\"center\"> </p>
<p align=\"center\">
<b><font color=\"#8000000\">Please logon again !! </font></b></p>
<p align=\"center\"> </p>
<p align=\"center\">
<a href=\"/private/login.htm\">Press here to logon</a></p>
</body>
</html>
";
}
init();
Thanks
|