我在验证登录详细信息后创建了一个会话,但是该会话未加载到仪表盘中吗?不知道为什么?该代码之前工作正常。尚未在标签中编写html代码。遵循基本的验证,创建和加载会话。在此之前,会话正在加载,但现在虽然它之前工作正常,但它只是不加载会话
login.pl
YYYY
Dashboard.pl
#!"C:\Strawberry\perl\bin\perl.exe"
use DBI;
use DBD::mysql;
use CGI qw/:standard/;
use CGI qw(:all);
use CGI::Session qw();
use CGI;
use CGI::Carp qw/fatalsToBrowser warningsToBrowser/;
use CGI::Session ( '-ip_match' );
use WWW::Mechanize;
require ('C:\xampp\htdocs\db\startraveltourhtml\startraveltourhtml\star-travel-1.2\db.pl');
$line="";
$flag=1;
$redirect="";
my $cgi = new CGI;
my $this_url = $cgi->url(); #Save this script's url
$email = $cgi->param('name');
$pass = $cgi->param('pass');
query_all($dbh);
sub query_all{
($dbh) = @_;
my $sql = "SELECT email, password
FROM registration
where email = '$email' ";
my $sth = $dbh->prepare($sql);
$sth->execute();
while(my $array_ref = $sth->fetchrow_arrayref()){
$email1=$array_ref->[0];
$pass1=$array_ref->[1];
}
$sth->finish();
$dbh->commit;
}
if($email1 eq $email and $pass1 eq $pass and $email ne "")
{
$session = CGI::Session->new();
$session->param('email', $email);
$q=$session->param('email');
print "email = ".$q;
print "<META HTTP-EQUIV=refresh CONTENT=\"1;URL=http://localhost/db/startraveltourhtml/startraveltourhtml/star-travel-1.2/dashboard.pl\">\n";
}
elsif($pass1 ne $pass)
{
$line="Password or username is not Same";
$flag=0;
}
else
{}