#! /path/to/perl -wT # THis is the login validation script # Import CGI module use strict; use CGI qw(:all delete_all escapeHTML); use common_subs; use "path/to/other/modules/"; # Create a new CGI object my $query = new CGI; # Create query objects to retrieve input my $username=$query->param('user'); my $passwd=$query->param('password'); my $next_page = "http://somepage.com"; my $loginOK = check_login($username,$passwd); print $query->header; print $query->start_html(-title=>'Validate Login',-bgcolor=>'white', -style=>{src=>'/IMG_PATH/templatestyles.css'}); # This is the common header defined in common_subs and # I use that in all scripts &display_header("Check Login"); if ($loginOK == 1) { print $query->b("Login successful! Loading next page....\n"); print $query->start_form(-name=>'data',-action=>$next_page); print $query->end_form(); print $query->script("setTimeout(\"document.data.submit();\",5000);"); } else{ print $query->font({-color=>"red"},$query->p("Login Failed!!!"), $query->br(), $query->p("Please go back to login screen and enter correct userid and password!!!")); ... etc... ... } # This is the common footer defined in common_subs and # I use that in all scripts &display_footer; print $query->end_html();