#!/usr/bin/perl ########################################################## ## This script is the main control panel for customers. ## ## Marvin ## ########################################################## ################### ## program setup ## ################### use CGI qw(param); use DBI; require("../tas.cfg"); ################## ## main program ## ################## &get_info; if ((!$cust_id) || (!$pd)) { &login_page; exit 0; } if (!&check_user) { &unauthorized_page; exit 0; } ################### ## sub-functions ## ################### sub get_info { $cust_id = param("cust_id"); $pd = param("password"); } sub check_user { $dbh = DBI->connect($database, $username, $password); $sql_statement = "select password, fname, lname, email from customer where id = '$cust_id'"; my $out = $dbh->prepare($sql_statement); $out->execute(); ($checkpass, $fname, $lname, $email) = $out->fetchrow_array; if ($checkpass eq "$pd") { return 1; } else { return 0; } } ############### ## web pages ## ############### sub login_page { &header; print <


Log in to your $vendor_name Affiliate account:

Affiliate ID:
Password:

(Click on the dog when you filled in the information.)

 

ENDBLOCK } sub unauthorized_page { &header; print <You are unauthorized to access this page.

 

 

 

ENDBLOCK } sub header { print < $vendor_name Affiliate Control Panel
 
ENDBLOCK }