Hello everybody i hope everybody is doin well, Actually i have a table in which i fetch the data from sqlite database,i have done the paging and filtering for the grid using per
This is not an answer to your question, but general advice. Therefore, I have made it community wiki.
Please stop writing CGI scripts for a while until you understand why your script has serious problems.
You have:
use CGI;
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
# ...
my $query = new CGI;
my $q = new CGI;
First, note that you need to initialize a CGI object only once. Avoid indirect method calls:
my $cgi = CGI->new;
I know the CGI.pm docs use $query
but I find $cgi
to be more meaningful.
That is a good step. Almost all CGI scripts should use well established libraries rather than homebrew code. However, after that good first step, you do:
print "Content-Type: text/html\n\n";
$query = $ENV{'QUERY_STRING'};
@list = split( /\&/, $query);
foreach (@list) {
($var, $val) = split(/=/);
$val =~ s/\'//g;
$val =~ s/\+/ /g;
$val =~ s/%(\w\w)/sprintf("%c", hex($1))/ge;
($var, ' = ', $val,);
}
There is no reason to engage in cargo-cult practices. Your CGI object already has the parameters passed to the script.
Also, you should declare your variables where they are first used as opposed to dumping all of them at the script.
Use CGI.pm's header
to send the header. You have:
print <