When I add use CGI::Session;
to my cgi file, I get this error:
An error occurred while writing CGI reply
If I comment that line its working fine.
I am using cPanel to host my site. What is the reason for this error? Is this missing the CGI::Session
module on the server of hosting service provider?
How to fix this issue?
Code:
#!/usr/local/bin/perl
use HTML::Template;
use DBI;
use CGI;
use CGI::Carp qw/fatalsToBrowser warningsToBrowser/;
#use CGI::Session ;
#send the obligatory Content-Type
print "Content-Type: text/html\n\n";
$user = '*******';
$password = '********';
#$session = CGI::Session->load();
#$q = new CGI;
$db_handle = DBI->connect ('DBI:mysql:database=amdvsfre_justclick',$user,$password)
or die "Couldn't connect to database: $DBI::errstr\n";
#set the value of SQL query
$sql_query = "SELECT t1.request_id, t1.request_message, t2.user_name, t2.user_city , COUNT(t3.request_id), t1.request_date, t1.request_time
FROM requests t1 INNER JOIN users t2 ON t1.user_id = t2.user_id
LEFT JOIN responses t3 ON t1.request_id = t3.request_id
GROUP BY t1.request_id desc" ;
...
...
passing the query result in template file, so that it can be displayed on the browser
If i uncommenting the #use CGI::Session ; then its giveing error. i need to import that file because i want to use session variable. how to fix the issue?