apache error when interfacing html with perl

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • happyse27
    New Member
    • Sep 2008
    • 236

    apache error when interfacing html with perl

    Hi All,

    I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration of section c.

    Not sure where went wrong as the web page displayed internal server error.

    Also, what is the error 543? and error 2114. Where to find the list of errors in websites as it is not the standard apache error. I could not find at all in internet, anything not set correctly or not defined? The cgi-bin direcfory in the script is proven correct and htdocs directory is also set correctly.

    The 2 Perl scripts below checked to be good without syntax error using e.g. : perl -c acctman.pl command.


    Great Thanks in advance,
    Andrew


    A1) Access log in apache
    =============== ===
    127.0.0.1 - - [17/Oct/2008:00:09:41 -0700] "GET /amform.html HTTP/1.1" 200 2114
    127.0.0.1 - - [17/Oct/2008:00:20:42 -0700] "POST /cgi-bin/acctman.pl HTTP/1.1" 500 543

    A2) error log in apache
    =============== =
    [Fri Oct 17 00:20:43 2008] [error] [client 127.0.0.1] Premature end of script headers: acctman.pl, referer: http://127.0.0.1/amform.html
    [Fri Oct 17 00:20:43 2008] [error] [client 127.0.0.1] Can't locate c:/program files/apache software foundation/apache2.2/cgi-bin/config.pl in @INC (@INC contains: C:/perl/site/lib C:/perl/lib .) at D:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/acctman.pl line 75.\r, referer: http://127.0.0.1/amform.html



    B) html page
    ==========

    Code:
    <!DOCTYPE HTML PUBLIC "-//SoftQuad//DTD HTML 3.2 + extensions for HoTMetaL PRO 3.0(U) 19961211//EN"
     "hmpro3.dtd">
    <HTML>
    <HEAD>
    <TITLE></TITLE></HEAD>
    <BODY>
    <FORM ACTION="/cgi-bin/acctman.pl" METHOD="POST">
    <CENTER>
    <TABLE BORDER="0" WIDTH="400">
    <TR>
    <TD ALIGN="CENTER">
    <TABLE BORDER="0" CELLPADDING="5" BGCOLOR="#FF8000">
    <TR>
    <TD><INPUT TYPE="CHECKBOX" NAME="agree" VALUE="agree"></TD>
    <TD><FONT SIZE="-1" FACE="verdana, arial, helvetica"><B>I agree to the Terms 
    and Conditions above.</B></FONT></TD></TR></TABLE><BR></TD></TR>
    <TR>
    <TD>
    <HR SIZE="2" NOSHADE="NOSHADE"></TD></TR>
    <TR>
    <TD ALIGN="CENTER">
    <TABLE BORDER="0" WIDTH="350" NOWRAP="NOWRAP">
    <TR>
    <TD><FONT SIZE="-1" FACE="verdana, arial, helvetica"><B>Customer Information</B></FONT><BR><FONT
    SIZE="-2" FACE="verdana, arial, helvetica" COLOR="#FF0000"><B>Fields marked 
    with an astriks<BR>are required input fields.</B></FONT><BR><BR></TD></TR>
    <TR>
    <TD><INPUT TYPE="TEXT" NAME="fname">
    <FONT SIZE="-1" FACE="verdana, arial, helvetica">First Name *</FONT></TD></TR>
    <TR>
    <TD><INPUT TYPE="TEXT" NAME="lname">
    <FONT SIZE="-1" FACE="verdana, arial, helvetica">Last Name *</FONT></TD></TR>
    <TR>
    <TD><INPUT TYPE="TEXT" NAME="email">
    <FONT SIZE="-1" FACE="verdana, arial, helvetica">E-Mail Address *</FONT></TD></TR></TABLE>
    <TABLE BORDER="0" WIDTH="350" NOWRAP="NOWRAP">
    <TR>
    <TD><BR><FONT SIZE="-1" FACE="verdana, arial, helvetica"><B>Choose a User 
    Name</B></FONT><BR><INPUT TYPE="TEXT" NAME="username"> 
    <FONT SIZE="-1" FACE="verdana, arial, helvetica">User Name</FONT>  
    <FONT SIZE="-1" FACE="arial, helvetica"><BR><BR><B>Choose a Password</B></FONT><BR>
            
    <INPUT TYPE="password" NAME="pwd">     
    <FONT SIZE="-1" FACE="verdana, arial, helvetica">Password</FONT><BR><INPUT
    TYPE="password" NAME="pwd2"> <FONT SIZE="-1" FACE="verdana, arial, helvetica">Verify
      Password</FONT></TD></TR></TABLE><BR><BR><INPUT
    TYPE="SUBMIT" NAME="process" VALUE="Submit My Order"><INPUT
    TYPE="RESET" NAME=""></TD></TR>
    <TR>
    <TD>
    <HR SIZE="2" NOSHADE="NOSHADE"></TD></TR></TABLE></CENTER></FORM></BODY></HTML>


    c) acctman.pl
    ==========
    Code:
    #!c:\perl\bin\perl.exe
    #!/usr/bin/perl
    ############################################
    ##                                        ##
    ##     Account Manager LITE User Signup   ##
    ##          by SiteInteractive.com        ##
    ##    http://siteinteractive.com/contact  ##
    ##                                        ##
    ##             version:  1.09             ##
    ##       last modified:  07/24/2002       ##
    ##        copyright (c) 1998 - 2002       ##
    ##                                        ##
    ##    latest version is available from    ##
    ##        http://SiteInteractive.com      ##
    ##                                        ##
    ############################################
    #
    # Copyright 1998 Elite Host.  All Rights Reserved.
    #
    # TERMS OF USE 
    # 1. Account Manager is for licensed customers
    # only. Customer may use Account Manager as many
    # times as customer wishes, as long as customer owns or runs the web
    # site that Account Manager is installed on.  Account
    # Manager may not under any circumstances be sold
    # or redistributed without the written consent of CGI Script Center and
    # its owner Diran Alemshah.
    #
    # 2. CGI Script Center, at its own discresion, will decide if any terms 
    # of the this agreement have been violated by customer. Upon written e-
    # mailed notification to Customer of Terms of Use violations, CGI
    # Script Center may revoke customer's license to use Account Manager.
    # In that event, Customer agrees to any and all of the following:
    #
    # a) Customers found in violation of this agreement, found reselling or
    # redistributing Account Manager, or making 
    # Customers Members Area ID and password public to anyone in any 
    # manner will forfeit their Members area password and all rights to 
    # future versions of Account Manager.
    # 
    # b). Customer will no longer be licensed to run any version of 
    # Account Manager. 
    #
    # Indemnification
    # 1. Customer agrees that it shall defend, indemnify, save and hold
    # CGI Script Center, Elite Web Design and marketing, and any
    # persons affiliated with either company, harmless from any and all
    # demands, liabilities, losses, costs and claims, including reasonable
    # attorney's fees asserted against CGI Script Center, its agents, its
    # customers, officers and employees, that may arise or result from any
    # service provided or performed or agreed to be performed or any product
    # sold by customer, its agents, employees or assigns. Customer agrees to
    # defend, indemnify and hold harmless CGI Script Center, its agents,
    # its cusomters, officers, and employes,against
    # liabilities arising out of; a) any injury to person or property caused
    # by an products sold or  otherwise distributed in connection with CGI
    # Script Center products; (b) any material supplied by customer
    # infringing or allegedly infringing on the proprietary rights of a
    # third party; c) copyright infringement and (d) any defective products
    # sold to customer from CGI Script Center products.
    #
    # This program may not be distributed in whole or part, freely, for pay, 
    # or any other form of compensation.
    #
    #################################################################
    # This version designed for Win32 systems (NT).  If you require
    # a Unix version, please contact cgi@elitehost.com
    #################################################################
    
    
    ##############################################################
    # EDIT USER CONFIGURATIONS BELOW
    ##############################################################
    
    require "c:/program files/apache software foundation/apache2.2/cgi-bin/config.pl";
    
    # This completes this portion of your Account Manager setup
    ##############################################################
    # DO NOT EDIT BELOW THIS LINE
    ##############################################################
    
    read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
    @pairs = split(/&/, $buffer);
    foreach $pair (@pairs) {
    	($name, $value) = split(/=/, $pair);
    	$value =~ tr/+/ /;
    	$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
    	if ($INPUT{$name}) { $INPUT{$name} = $INPUT{$name}.",".$value; }
    	else { $INPUT{$name} = $value; }
          $value =~ s/<!--(.|\n)*-->//g;
    }
    
    $version = "1.08";
    
    $cgiurl = $ENV{'SCRIPT_NAME'};
    
    if ($INPUT{'find'}) { &find; } ######### Will search for member info.
    if ($INPUT{'process'}) { &sorder; } 
    #elsif ($INPUT{'order'}) { &order; }
    #elsif ($INPUT{'sorder'}) {&sorder; } 
    else {&sorder;}############# IF no button was pressed, run just as 
    exit;
    
    
    sub sorder {
    
    unless ($INPUT{'agree'}) {
    print "Content-type: text/html\n\n";
    &header;
    print<<EOF;
    <CENTER><BR>
    <TABLE BORDER="0" WIDTH="400"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR><TD
    COLSTART="1"><CENTER><P><B><FONT FACE="verdana, arial, helvetica"><FONT
    COLOR="#FF0000">Account Manager</FONT> Status:<BR>You Must Agree.</FONT></B></P></CENTER>
    <P><FONT SIZE="-1" COLOR="$fontcolor" FACE="verdana, arial, helvetica">In order for us to process your request, you must check the box marked <B>"I agree to the above"</B> on our order form.</FONT></P>
    <P><FONT SIZE="-1" COLOR="$fontcolor" FACE="verdana, arial, helvetica">If you need further
    assistance, please contact <A HREF="mailto:$orgmail">$orgname Support</A>.</FONT></P>
    <CENTER><TABLE BORDER="0" WIDTH="400"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR
    ><TD COLSTART="1"><HR SIZE="1">
    <CENTER><FONT SIZE="-2" FACE="verdana, arial, helvetica">$orgname
    maintained with <B><A HREF="http://cgi.elitehost.com/">Account Manager $version</A></B></FONT> 
    </CENTER></TD></TR></ROWS></TBODY></TABLE></CENTER></TD></TR></ROWS></TBODY></TABLE></CENTER>
    EOF
    &footer;
    exit;
    }
    
    
    unless ($INPUT{'fname'}) {
    print "Content-type: text/html\n\n";
    &header;
    print<<EOF;
    <CENTER><BR>
    <TABLE BORDER="0" WIDTH="400"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR><TD
    COLSTART="1"><CENTER><P><B><FONT FACE="verdana, arial, helvetica"><FONT
    COLOR="#FF0000">Account Manager</FONT> Status:<BR>Please Enter Your First Name.</FONT></B></P></CENTER>
    <P><FONT SIZE="-1" COLOR="$fontcolor" FACE="verdana, arial, helvetica">Please don't forget to enter <B>your first name</B> in our service request form.</FONT></P>
    <P><FONT SIZE="-1" COLOR="$fontcolor" FACE="verdana, arial, helvetica">If you need further
    assistance, please contact <A HREF="mailto:$orgmail">$orgname Support</A>.</FONT></P>
    <CENTER><TABLE BORDER="0" WIDTH="400"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR
    ><TD COLSTART="1"><HR SIZE="1">
    <CENTER><FONT SIZE="-2" FACE="verdana, arial, helvetica">$orgname
    maintained with <B><A HREF="http://cgi.elitehost.com/">Account Manager $version</A></B></FONT> 
    </CENTER></TD></TR></ROWS></TBODY></TABLE></CENTER></TD></TR></ROWS></TBODY></TABLE></CENTER>
    EOF
    &footer;
    exit;
    }
    
    unless ($INPUT{'lname'}) {
    print "Content-type: text/html\n\n";
    &header;
    print<<EOF;
    <CENTER><BR>
    <TABLE BORDER="0" WIDTH="400"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR><TD
    COLSTART="1"><CENTER><P><B><FONT FACE="verdana, arial, helvetica"><FONT
    COLOR="#FF0000">Account Manager</FONT> Status:<BR>Please Enter Your Last Name.</FONT></B></P></CENTER>
    <P><FONT SIZE="-1" COLOR="$fontcolor" FACE="verdana, arial, helvetica">Please don't forget to enter <B>your last name</B> in our service request form.</FONT></P>
    <P><FONT SIZE="-1" COLOR="$fontcolor" FACE="verdana, arial, helvetica">If you need further
    assistance, please contact <A HREF="mailto:$orgmail">$orgname Support</A>.</FONT></P>
    <CENTER><TABLE BORDER="0" WIDTH="400"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR
    ><TD COLSTART="1"><HR SIZE="1">
    <CENTER><FONT SIZE="-2" FACE="verdana, arial, helvetica">$orgname
    maintained with <B><A HREF="http://cgi.elitehost.com/">Account Manager $version</A></B></FONT> 
    </CENTER></TD></TR></ROWS></TBODY></TABLE></CENTER></TD></TR></ROWS></TBODY></TABLE></CENTER>
    EOF
    &footer;
    exit;
    }
    
    
    
    $INPUT{'email'} =~ s/\s//g;
    
    unless ($INPUT{'email'} =~ /(@.*@)|(\.\.)|(@\.)|(^\.)|(,)|(\/)|(\:)/
    	  || $INPUT{'email'} !~
    	  /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/)
    	  {
             $legalemail = 1;
            } else {
             $legalemail = 0;
            }
    
    
    if ($legalemail !~ 1) {
    print "Content-type: text/html\n\n";
    &header;
    print<<EOF;
    <CENTER><BR>
    <TABLE BORDER="0" WIDTH="400"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR><TD
    COLSTART="1"><CENTER><P><B><FONT FACE="verdana, arial, helvetica"><FONT
    COLOR="#FF0000">Account Manager</FONT> Status:<BR>Please Enter Your E-Mail Address.</FONT></B></P></CENTER>
    <P><FONT SIZE="-1" COLOR="$fontcolor" FACE="verdana, arial, helvetica">Please don't forget to enter <B>your E-mail address</B> in our service request form.</FONT></P>
    <P><FONT SIZE="-1" COLOR="$fontcolor" FACE="verdana, arial, helvetica">If you need further
    assistance, please contact <A HREF="mailto:$orgmail">$orgname Support</A>.</FONT></P>
    <CENTER><TABLE BORDER="0" WIDTH="400"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR
    ><TD COLSTART="1"><HR SIZE="1">
    <CENTER><FONT SIZE="-2" FACE="verdana, arial, helvetica">$orgname
    maintained with <B><A HREF="http://cgi.elitehost.com/">Account Manager $version</A></B></FONT> 
    </CENTER></TD></TR></ROWS></TBODY></TABLE></CENTER></TD></TR></ROWS></TBODY></TABLE></CENTER>
    EOF
    &footer;
    exit;
    }
    
    
    &add;
    }
    
    
    
    sub close {
    
    open (FILE,"$memberinfo/email.txt"); #### Full path name from root.
    @closing  = <FILE>;
    close(FILE);
    
    open(MAIL,">$tempdir\\$INPUT{'email'}") || die("Cannot open $tempdir\\$INPUT{'email'} -- Check Directory Permissions : $!"); 
     
        print MAIL "To: $INPUT{'email'}\n";
        print MAIL "From: $orgmail ($orgname)\n";
        print MAIL "Subject: $response_subject\n";
        print MAIL "-" x 75 . "\n\n";
        
        
    
                            
        foreach $line(@closing) {
        $line =~ s/<FIRST_NAME>/$INPUT{'fname'}/g;
        $line =~s/<LAST_NAME>/$INPUT{'lname'}/g;
        $line =~ s/<USERNAME>/$INPUT{'username'}/g;
        $line =~s/<PASSWORD>/$INPUT{'pwd'}/g;
        $line =~s/<ORGNAME>/$orgname/g;
        $line =~s/<ORGMAIL>/$orgmail/g;
        print MAIL "$line";
        }
    
        print MAIL"\n\n";
        close (MAIL);
    
          
     
            #'use' the process module.
            use Win32::Process;
            
            #theWin32:: module. Includes the Win32 error checking etc.
            # see Win32:: section for included functions.
            use Win32;
            
            #sub Error{ 
            #print Win32::FormatMessage( Win32::GetLastError() );
            #}
            #Create the process object.
            Win32::Process::Create($ProcessObj, $mailprog, "Blat $tempdir\\$INPUT{'email'} -t $INPUT{'email'} -s \"$response_subject\" -i \"$orgmail ($orgname)\" ", 0, DETACHED_PROCESS, ".")|| die ; 
            #Set the process priority
            #$ProcessObj->SetPriority(NORMAL_PRIORITY_CLASS)||die ;
    
            #Wait for the process to end. NO timeout 
            $ProcessObj->Wait(INFINITE);
            unlink("$tempdir\\$INPUT{'email'}");
    
                  
    
    #################################################################
    ## MAIL BACK TO ADMIN ###########################################
    #################################################################
    
    open(MAIL,">$tempdir\\$orgmail") || die("Cannot open $tempdir\\$orgmail -- Check Directory Permissions : $!"); 
     
        print MAIL "To: $orgmail\n";
        print MAIL "From: $INPUT{'email'} ($INPUT{'fname'} $INPUT{'lname'})\n";
        print MAIL "Subject: $signupresponse\n";
        print MAIL "-" x 75 . "\n\n";
        
        print MAIL "Customer Information\n";
        print MAIL "-" x 75 . "\n\n";
        print MAIL "Name: $INPUT{'fname'} $INPUT{'lname'}\n";
        print MAIL "Email: $INPUT{'email'}\n\n";
        
    
    
    
        close (MAIL);
    
          
     
            #'use' the process module.
            use Win32::Process;
            
            #theWin32:: module. Includes the Win32 error checking etc.
            # see Win32:: section for included functions.
            use Win32;
            
            #sub Error{ 
            #print Win32::FormatMessage( Win32::GetLastError() );
            #}
            #Create the process object.
            Win32::Process::Create($ProcessObj, $mailprog, "Blat $tempdir\\$orgmail -t $orgmail -s \"$signupresponse\" -i \"$INPUT{'email'} ($INPUT{'fname'} $INPUT{'lname'})\" ", 0, DETACHED_PROCESS, ".")|| die ; 
            #Set the process priority
            #$ProcessObj->SetPriority(NORMAL_PRIORITY_CLASS)||die ;
    
            #Wait for the process to end. NO timeout 
            $ProcessObj->Wait(INFINITE);
            unlink("$tempdir\\$orgmail");
    
    
    
    
    print "Content-type: text/html\n\n";
    &header;
    print<<EOF;
    <CENTER><BR>
    <TABLE BORDER="0" WIDTH="400"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR><TD
    COLSTART="1"><P><B><FONT FACE="verdana, arial, helvetica"><FONT
    COLOR="#FF0000">Account
    Manager</FONT> Status:  Success!</FONT></B></P>
    <P><FONT SIZE="-1" COLOR="$fontcolor" FACE="verdana, arial, helvetica">Your $orgname account information has been sent to the site administrators.  You should receive a response shortly.  Thank you for your interest.</FONT></P>
    <P><FONT SIZE="-1" COLOR="$fontcolor" FACE="verdana, arial, helvetica">Please contact
    <A HREF="mailto:$orgmail">$orgname Support</A> if you
    need any further assistance.</FONT></P>
    <HR SIZE="1">
    <CENTER><FONT SIZE=\"-2\" FACE=\"verdana, arial, helvetica\"> $orgname is maintained with  <A
    HREF=\"http://cgi.elitehost.com\"><B>Account Manager $version</B></A></FONT>
    </CENTER> 
    </TD></TR></ROWS></TBODY></TABLE></CENTER>
    EOF
    &footer;
    exit;
    }
    
    #}
    
    sub checkaddress {
    
    $INPUT{'email'} =~ s/\s//g;
    
    unless ($INPUT{'email'} =~ /(@.*@)|(\.\.)|(@\.)|(^\.)|(,)|(\/)|(\:)/
    	  || $INPUT{'email'} !~
    	  /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/)
    	  {
             $legalemail = 1;
            } else {
             $legalemail = 0;
            }
    
    
    if ($legalemail !~ 1) {
    print "Content-type: text/html\n\n";
    &header;
    print<<EOF;
    <CENTER><BR>
    <TABLE BORDER="0" WIDTH="400"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR><TD
    COLSTART="1"><CENTER><P><B><FONT FACE="verdana, arial, helvetica"><FONT
    COLOR="#FF0000">Account Manager</FONT> Status:<BR>Please Enter Your E-Mail Address.</FONT></B></P></CENTER>
    <P><FONT SIZE="-1" COLOR="$fontcolor" FACE="verdana, arial, helvetica">Please don't forget to enter <B>your E-mail address</B> in our service request form.</FONT></P>
    <P><FONT SIZE="-1" COLOR="$fontcolor" FACE="verdana, arial, helvetica">If you need further
    assistance, please contact <A HREF="mailto:$orgmail">$orgname Support</A>.</FONT></P>
    <CENTER><TABLE BORDER="0" WIDTH="400"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR
    ><TD COLSTART="1"><HR SIZE="1">
    <CENTER><FONT SIZE="-2" FACE="verdana, arial, helvetica">$orgname
    maintained with <B><A HREF="http://cgi.elitehost.com/">Account Manager $version</A></B></FONT> 
    </CENTER></TD></TR></ROWS></TBODY></TABLE></CENTER></TD></TR></ROWS></TBODY></TABLE></CENTER>
    EOF
    &footer;
    exit;
    }
    }
    
    sub find {
    
    &checkaddress;
    
    # Open member database, read info
    open (DAT,"<$memberinfo/amdata.db");
    if ($LOCK_EX){ 
          flock(DAT, $LOCK_EX); #Locks the file
    	}
     @database_array = <DAT>;
     close (DAT);
    
    foreach $lines(@database_array) {
              @edit_array = split(/\:/,$lines);
    
    &parseemail;
    # if ($edit_array[2] =~ /$INPUT{'email'}/i) {last; }
    
    if ($edit_array[2] eq $email) {last; }
    
    }
    
    # unless ($edit_array[2] =~ /$INPUT{'email'}/i) {
    
    unless ($edit_array[2] eq $email) {
    
    print "Content-type: text/html\n\n";
    &header;
    print "<CENTER><BR><TABLE
    BORDER=\"0\" WIDTH=\"450\"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR><TD
    COLSTART=\"1\"><P><B><FONT FACE=\"verdana, arial, helvetica\"><FONT
    COLOR=\"#FF0000\">Account Manager</FONT> Status:  Not Found!</FONT></B></P><P><FONT
    SIZE=\"-1\" COLOR=\"$fontcolor\" FACE=\"verdana, arial, helvetica\">Your $orgname account information was not found in our database.  Please make sure that you used the same email address that you created your account with.</FONT></P><P><FONT
    SIZE=\"-1\" COLOR=\"$fontcolor\" FACE=\"verdana, arial, helvetica\">Please contact <A
    HREF=\"mailto:$orgmail\">$orgname Support</A> for your account information.</FONT></P><HR
    SIZE=\"1\"><CENTER><FONT SIZE=\"-2\" FACE=\"verdana, arial, helvetica\"> $orgname is maintained with  <A
    HREF=\"http://cgi.elitehost.com\"><B>Account Manager $version</B></A></FONT>
    </CENTER></TD></TR></ROWS></TBODY></TABLE></CENTER>";
    &footer;
    exit;
    } 
    
    print "Content-type: text/html\n\n";
    &header;
    print "<CENTER><BR><TABLE
    BORDER=\"0\" WIDTH=\"450\"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR><TD
    COLSTART=\"1\"><P><B><FONT FACE=\"verdana, arial, helvetica\"><FONT
    COLOR=\"#FF0000\">Account Manager</FONT> Status:  Success!</FONT></B></P><P><FONT
    SIZE=\"-1\" COLOR=\"$fontcolor\" FACE=\"verdana, arial, helvetica\">Your $orgname account information has been emailed to you at: $INPUT{'email'}.</FONT></P><P><FONT
    SIZE=\"-1\" COLOR=\"$fontcolor\" FACE=\"verdana, arial, helvetica\">Please contact <A
    HREF=\"mailto:$orgmail\">$orgname Support</A> if you need any further assistance.</FONT></P><HR
    SIZE=\"1\"><CENTER><FONT SIZE=\"-2\" FACE=\"verdana, arial, helvetica\"> $orgname is maintained with  <A
    HREF=\"http://cgi.elitehost.com\"><B>Account Manager $version</B></A></FONT>
    </CENTER></TD></TR></ROWS></TBODY></TABLE></CENTER>";
    &footer;
    
    # Output a temporary file
    
        open(MAIL,">$tempdir\\$edit_array[2]") || die("Cannot open $tempdir\\$edit_array[2] -- Check Directory Permissions : $!"); 
        
        print MAIL "To: $edit_array[2]\n";
        print MAIL "From: $orgmail ($orgname Support)\n";
    
        #Date
        print MAIL "$date\n";
        
        # Check for Message Subject
        print MAIL "Subject: $orgname Account Information\n\n";
        print MAIL "-" x 75 . "\n\n";
    
        print MAIL "You requested your $orgname account information:\n\n";
    
        print MAIL "Your $orgname User ID is: $edit_array[0]\n";
        print MAIL "Your $orgname password is: $edit_array[1]\n\n";
    
        print MAIL "please contact $orgname support at: $orgmail\n";
        print MAIL "if you have any questions.\n\n";
    
        print MAIL "$orgname Support Team\n";    
    
        close (MAIL);
     
            #'use' the process module.
            use Win32::Process;
            
            #theWin32:: module. Includes the Win32 error checking etc.
            # see Win32:: section for included functions.
            use Win32;
            
            #sub Error{ 
            #print Win32::FormatMessage( Win32::GetLastError() );
            #}
            #Create the process object.
            Win32::Process::Create($ProcessObj, $mailprog, "Blat $tempdir\\$edit_array[2] -t $edit_array[2] -s \"$orgname Account Information\" -i \"$orgmail ($orgname Support)\" ", 0, DETACHED_PROCESS, ".")|| die ; 
            #Set the process priority
            #$ProcessObj->SetPriority(NORMAL_PRIORITY_CLASS)||die ;
    
            #Wait for the process to end. NO timeout 
            $ProcessObj->Wait(INFINITE);
            unlink("$tempdir\\$edit_array[2]");
            
    exit;
    
    }
    
    sub add {
    
    
    unless ($INPUT{'username'}) {
    print "Content-type: text/html\n\n";
    &header;
    print "<CENTER><TABLE BORDER=\"0\" WIDTH=\"450\"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR
    ><TD ALIGN=\"CENTER\" COLSTART=\"1\">     
    <FONT SIZE=\"+1\" FACE=\"verdana, arial, helvetica\"><FONT COLOR=\"#FF0000\">Account
    Manager:</FONT><BR>Account Information Input Form</FONT><BR><BR>
    <TABLE BORDER=\"0\"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR><TD
    ALIGN=\"LEFT\" COLSTART=\"1\"><FONT SIZE=\"+1\" COLOR=\"$fontcolor\" FACE=\"verdana, arial, helvetica\"><B>Username
    Error!  No Username</B></FONT><BR><BR><FONT
    SIZE=\"-1\" FACE=\"verdana, arial, helvetica\">Please go back and a Username.</FONT></TD></TR><TR><TD COLSTART=\"1\"><HR SIZE=\"1\">
    <CENTER><FONT SIZE=\"-2\" FACE=\"verdana, arial, helvetica\"> $orgname is maintained with  <A
    HREF=\"http://cgi.elitehost.com\"><B>Account Manager $version</B></A></FONT>
    </CENTER> </TD></TR></ROWS></TBODY></TABLE></TD></TR></ROWS></TBODY></TABLE></CENTER>";
    &footer;
    exit;
        } 
    
    
    
    
    if ($INPUT{'username'} =~ /\s/) {
    print "Content-type: text/html\n\n";
    &header;
    print "<CENTER><TABLE BORDER=\"0\" WIDTH=\"450\"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR
    ><TD ALIGN=\"CENTER\" COLSTART=\"1\">     
    <FONT SIZE=\"+1\" FACE=\"verdana, arial, helvetica\"><FONT COLOR=\"#FF0000\">Account
    Manager:</FONT><BR>Account Information Input Form</FONT><BR><BR>
    <TABLE BORDER=\"0\"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR><TD
    ALIGN=\"LEFT\" COLSTART=\"1\"><FONT SIZE=\"+1\" COLOR=\"$fontcolor\" FACE=\"verdana, arial, helvetica\"><B>Username
    Error!  Username Contains a Space</B></FONT><BR><BR><FONT
    SIZE=\"-1\" FACE=\"verdana, arial, helvetica\">Please go back and enter a Username without spaces.  If you would like to use a multi-word Username, be sure to use an underscore ( _ ).</FONT></TD></TR><TR><TD COLSTART=\"1\"><HR SIZE=\"1\">
    <CENTER><FONT SIZE=\"-2\" COLOR=\"$fontcolor\" FACE=\"verdana, arial, helvetica\"> $orgname is maintained with  <A
    HREF=\"http://cgi.elitehost.com\"><B>Account Manager $version</B></A></FONT>
    </CENTER> </TD></TR></ROWS></TBODY></TABLE></TD></TR></ROWS></TBODY></TABLE></CENTER>";
    &footer;
    exit;
        }
    
    if ($INPUT{'username'} eq $INPUT{'pwd'}) {
    
    print "Content-type: text/html\n\n";
    &header;
    print "<CENTER><TABLE BORDER=\"0\" WIDTH=\"450\"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR
    ><TD ALIGN=\"CENTER\" COLSTART=\"1\">     
    <FONT SIZE=\"+1\" FACE=\"verdana, arial, helvetica\"><FONT COLOR=\"#FF0000\">Account Manager:</FONT><BR>  Account Information Input Form</FONT><BR><BR>
    <TABLE BORDER=\"0\"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR><TD
    ALIGN=\"LEFT\" COLSTART=\"1\"><FONT SIZE=\"+1\" COLOR=\"$fontcolor\" FACE=\"verdana, arial, helvetica\"><B>Password Error!  Same as Username</B></FONT><BR><BR><FONT
    SIZE=\"-1\" FACE=\"verdana, arial, helvetica\">You must chose a Password other than your Username, for security considerations.  Please return and enter another password.</FONT></TD></TR>
    
    </ROWS></TBODY></TABLE></TD></TR></ROWS></TBODY></TABLE></CENTER>";
    &footer;
    exit;
    }
    
    unless ($INPUT{'pwd'} eq $INPUT{'pwd2'} && $INPUT{'pwd'} && $INPUT{'pwd2'} ){
    
    print "Content-type: text/html\n\n";
    &header;
    print "<CENTER><TABLE BORDER=\"0\" WIDTH=\"450\"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR
    ><TD ALIGN=\"CENTER\" COLSTART=\"1\">     
    <FONT SIZE=\"+1\" FACE=\"verdana, arial, helvetica\"><FONT COLOR=\"#FF0000\">Account
    Manager:</FONT><BR>Account Information Input Form</FONT><BR><BR>
    <TABLE BORDER=\"0\"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR><TD
    ALIGN=\"LEFT\" COLSTART=\"1\"><FONT SIZE=\"+1\" COLOR=\"$fontcolor\" FACE=\"verdana, arial, helvetica\"><B>Password
    Error!  Password Mismatch</B></FONT><BR><BR><FONT
    SIZE=\"-1\" FACE=\"verdana, arial, helvetica\">Please go back and re-enter your
    password choice.</FONT></TD></TR><TR><TD COLSTART=\"1\"><HR SIZE=\"1\">
    <CENTER><FONT SIZE=\"-2\" FACE=\"verdana, arial, helvetica\"> $orgname is maintained with  <A
    HREF=\"http://cgi.elitehost.com\"><B>Account Manager $version</B></A></FONT>
    </CENTER> </TD></TR></ROWS></TBODY></TABLE></TD></TR></ROWS></TBODY></TABLE></CENTER>";
    &footer;
    exit;
        } 
    
    
    if (-e "$memberinfo/amdata.db") {
    
    open (MEMBER, "<$memberinfo/amdata.db");
    if ($LOCK_EX){ 
          flock(MEMBER, $LOCK_EX); #Locks the file
    	}
    @database_array = <MEMBER>;
     close (MEMBER);
    
    foreach $lines(@database_array) {
              @edit_array = split(/\:/,$lines);
        &parseusername2;
    
    #    if ($edit_array[0] eq $INPUT{'username'}) {last; }
    
    if (($edit_array[0]) && ($edit_array[0] eq $desiredname)) {last; }
        
    }
    
    $INPUT{'username'} =~ s/\W.*//;
    # if ($edit_array[0] eq $INPUT{'username'}) {
    
    if (($edit_array[0]) && ($edit_array[0] eq $desiredname)) {
    
    print "Content-type: text/html\n\n";
    &header;
    print "<CENTER><TABLE BORDER=\"0\" WIDTH=\"450\"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR
    ><TD ALIGN=\"CENTER\" COLSTART=\"1\">     
    <FONT SIZE=\"+1\" FACE=\"verdana, arial, helvetica\"><FONT COLOR=\"#FF0000\">Account Manager:</FONT><BR>User Name Taken</FONT><BR><BR>
    <TABLE BORDER=\"0\"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR><TD
    ALIGN=\"LEFT\" COLSTART=\"1\"><FONT SIZE=\"+1\" FACE=\"verdana, arial, helvetica\"><B>User Name Error!  User Name Taken</B></FONT><BR><BR><FONT
    SIZE=\"-1\" COLOR=\"$fontcolor\" FACE=\"verdana, arial, helvetica\">The User Name you have selected is already in use by another user.  Please return and enter another user name.</FONT></TD></TR>
    <TR><TD COLSTART=\"1\"><HR SIZE=\"1\">
    <CENTER><FONT SIZE=\"-2\" FACE=\"verdana, arial, helvetica\"> $orgname is maintained with  <A
    HREF=\"http://cgi.elitehost.com\"><B>Account Manager $version</B></A></FONT>
    </CENTER></TD></TR></ROWS></TBODY></TABLE></TD></TR></ROWS></TBODY></TABLE></CENTER>";
    &footer;
    exit;
    }
    
    
    }
    &dupeaddress;
    &dupeaddress2;
    &usertemp;
    #&dupepwd;
    &temp;
    exit;
    }
    
    sub usertemp {
    
    
    opendir (DIR, "$memberinfo"); 
    @file = grep { /.infotmp/} readdir(DIR);
    foreach $lines(@file) {
     $lines =~ s/\W.*//;
    
    &parseusername;
    
    if ($lines eq $desiredname) {
    
    # if ($lines =~ /$INPUT{'username'}\b/i) {
    print "Content-type: text/html\n\n";
    &header; 
    print<<EOF;
    <CENTER><BR>
    <TABLE BORDER="0" WIDTH="450"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR><TD
    COLSTART="1"><P><B><FONT FACE="verdana, arial, helvetica"><FONT
    COLOR="#FF0000">Account
    Manager</FONT> Status:  Username Taken!</FONT></B></P>
    <P><FONT SIZE="-1" COLOR="$fontcolor" FACE="verdana, arial, helvetica">The Username: $INPUT{'username'} has already been reserved by someone awaiting membership</FONT></P>
    <P><FONT SIZE="-1" COLOR="$fontcolor" FACE="verdana, arial, helvetica">Please choose another Username.</FONT></P>
    <HR SIZE="1">
    <CENTER><FONT SIZE="-2" FACE="verdana, arial, helvetica"><B>$orgname maintained with
    <A HREF="http://cgi.elitehost.com/"><B>Account Manager $version</B></A></B></FONT> 
    </CENTER></TD></TR></ROWS></TBODY></TABLE></CENTER>
    EOF
    &footer;
      exit;   
        
    }
    }
    }
    
    sub dupeaddress {
    #print "Content-type: text/html\n\n";
    open (EMAIL, "<$memberinfo/amdata.db");
    if ($LOCK_EX){ 
          flock(EMAIL, $LOCK_EX); #Locks the file
    	}
    @database_array = <EMAIL>;
     close (EMAIL);
    
    foreach $lines(@database_array) {
              @edit_array = split(/\:/,$lines);
    &parseemail;
    
    if ($edit_array[2] eq $email) {
    
    # if ($edit_array[2] =~ /$INPUT{'email'}/i) {
    print "Content-type: text/html\n\n";
    &header;
    print<<EOF;
    <CENTER><BR>
    <TABLE BORDER="0" WIDTH="450"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR><TD
    COLSTART="1"><P><B><FONT FACE="verdana, arial, helvetica"><FONT
    COLOR="#FF0000">Account
    Manager</FONT> Status:  Address Taken!</FONT></B></P>
    <P><FONT SIZE="-1" COLOR="$fontcolor" FACE="verdana, arial, helvetica">The E-mail address: $INPUT{'email'} is already in our database. </FONT></P>
    <P><FONT SIZE="-1" COLOR="$fontcolor" FACE="verdana, arial, helvetica">Please contact
    <A HREF="mailto:$orgmail"><B>$orgname Support</B></A> if you
    need any further assistance.</FONT></P>
    <HR SIZE="1">
    <CENTER><FONT SIZE="-2" FACE="verdana, arial, helvetica"><B>$orgname maintained with
    <A HREF="http://cgi.elitehost.com/"><B>Account Manager $version</B></A></B></FONT> 
    </CENTER></TD></TR></ROWS></TBODY></TABLE></CENTER>
    EOF
    &footer;
    exit;
    }
    }
    }
    
    sub dupeaddress2 {
    
    
    opendir (DIR, "$memberinfo");
    close (DIR); 
    @file = grep { /.infotmp/} readdir(DIR);
     foreach $lines(@file) {
    
           open (DAT, "<$memberinfo/$lines");
    if ($LOCK_EX){ 
          flock(DAT, $LOCK_EX); #Locks the file
    	} 
                 @approval = <DAT>;
                    foreach $item(@approval) {
                        @edit_approval = split(/\:/,$item);
                      
     &parseemail;                 
    
    if ($edit_approval[2] eq $email) {last; }
    
    # if ($edit_approval[2] =~ /$INPUT{'email'}/i) {last; }
    }
    
    if ($edit_approval[2] eq $email) {
    
    # if ($edit_approval[2] =~ /$INPUT{'email'}/i) {
    print "Content-type: text/html\n\n";
    &header;
    print<<EOF;
    <CENTER><BR>
    <TABLE BORDER="0" WIDTH="450"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR><TD
    COLSTART="1"><P><B><FONT FACE="verdana, arial, helvetica"><FONT
    COLOR="#FF0000">Account
    Manager</FONT> Status:  Address Taken!</FONT></B></P>
    <P><FONT COLOR="$fontcolor" SIZE="-1" FACE="verdana, arial, helvetica">The E-mail address:
    $INPUT{'email'} was found in use by someone awaiting membership.</FONT></P>
    <P><FONT COLOR="$fontcolor" SIZE="-1" FACE="verdana, arial, helvetica">Please contact
    <A HREF="mailto:$orgmail"><B>$orgname Support</B></A> if you need any further
    assistance.</FONT></P>
    <HR SIZE="1">
    <CENTER><FONT SIZE="-2" FACE="verdana, arial, helvetica"><B>$orgname
    maintained with
    <A HREF="http://cgi.elitehost.com/"><B>Account Manager $version</B></A></B></FONT> 
    </CENTER></TD></TR></ROWS></TBODY></TABLE></CENTER>
    EOF
    &footer;
    #close (DIR);
    exit;
    
    }
    }
    }
    
    sub dupepwd {
    
    
    opendir (DIR, "$memberinfo");
    close (DIR); 
    @file = grep { /.infotmp/} readdir(DIR);
     foreach $lines(@file) {
    
           open (DAT, "<$memberinfo/$lines");
    if ($LOCK_EX){ 
          flock(DAT, $LOCK_EX); #Locks the file
    	} 
                 @approval = <DAT>;
                    foreach $item(@approval) {
                        @edit_approval = split(/\:/,$item);
                      
     if ($edit_approval[1] =~ /$INPUT{'pwd'}\b/i) {last; }
    }
    
    if ($edit_approval[1] =~ /$INPUT{'pwd'}\b/i) {
    print "Content-type: text/html\n\n";
    &header;
    print<<EOF;
    <CENTER><BR>
    <TABLE BORDER="0" WIDTH="450"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR><TD
    COLSTART="1"><P><B><FONT FACE="verdana, arial, helvetica"><FONT
    COLOR="#FF0000">Account
    Manager</FONT> Status:  Address Taken!</FONT></B></P>
    <P><FONT SIZE="-1" COLOR="$fontcolor" FACE="verdana, arial, helvetica">The Password you chose has already been requested by a new prospective user.  Please choose another.</FONT></P>
    <P><FONT SIZE="-1" COLOR="$fontcolor" FACE="verdana, arial, helvetica">Please contact
    <A HREF="mailto:$orgmail"><B>$orgname Support</B></A> if you need any further
    assistance.</FONT></P>
    <HR SIZE="1">
    <CENTER><FONT SIZE="-2" FACE="verdana, arial, helvetica"><B>$orgname
    maintained with
    <A HREF="http://cgi.elitehost.com/"><B>Account Manager $version</B></A></B></FONT> 
    </CENTER></TD></TR></ROWS></TBODY></TABLE></CENTER>
    EOF
    &footer;
    #close (DIR);
    exit;
    
    }
    }
    }
    
    
    ######################################
    # Create temp files for Admin approval
    ######################################
    
    sub temp {
    
    
    
    $INPUT{'fname'} =~ s/\s+$//;
    $INPUT{'lname'} =~ s/\s+$//;
    
    
    $newline2 = join
    ("\:",$INPUT{'username'},$INPUT{'pwd'},$INPUT{'email'},$INPUT{'fname'},$INPUT{'lname'},$setup,$monthly,$INPUT{'payment'},$INPUT{'creditcards'},$INPUT{'nameoncard'},$INPUT{'cardnumber'},$INPUT{'exp'},$INPUT{'billingaddress'},$INPUT{'billingaddress2'},$INPUT{'city'},$INPUT{'state'},$INPUT{'zip'},$INPUT{'lbill'},$INPUT{'papplied'},$INPUT{'aapplied'},$INPUT{'tbalance'},$INPUT{'tnew'},$INPUT{'tcharges'},$INPUT{'nnew'},$INPUT{'linvoice'},$INPUT{'taxes'},$INPUT{'ccity'},$INPUT{'cstate'},$INPUT{'czip'},0);
    $newline2 .= "\n";
    
    open(TEMP2, ">$memberinfo/$INPUT{'username'}.infotmp") or print "unable to create user info temp file.  Check your directory permission settings";
    if ($LOCK_EX){ 
          flock(TEMP2, $LOCK_EX); #Locks the file
    	}
    print TEMP2 $newline2;
    close (TEMP2);
    
    #unlink ("$memberinfo/$INPUT{'username'}.infotmp");
    
    
    #}
    
    if ($INPUT{$lines}) {
    unlink ("$memberinfo/$lines");
    
    
    
    }
    
    #}
    &close;
    
    exit;
    
    }
    
    
    
    sub parseusername {
    $desiredname = $INPUT{'username'};
    $lines =~ tr/A-Z/a-z/;
    $desiredname =~ tr/A-Z/a-z/;
    }
    
    sub parseusername2 {
    $desiredname = $INPUT{'username'};
    $edit_array[0] =~ tr/A-Z/a-z/;
    $desiredname =~ tr/A-Z/a-z/;
    }
    
    
    sub parseemail {
    $email = $INPUT{'email'};
    $edit_array[2] =~ tr/A-Z/a-z/;
    $email =~ tr/A-Z/a-z/;
    }
    
    
    
    
    sub header {
    open (FILE,"<$header/header.txt"); #### Full path name from root. 
     @headerfile = <FILE>;
     close(FILE);
    print "<HTML><HEAD><TITLE></TITLE></HEAD><BODY $bodyspec>\n";
    foreach $line(@headerfile) {
    print "$line";
      }
    }
    
    
    sub footer {
    open (FILE,"<$footer/footer.txt"); #### Full path name from root. 
     @footerfile = <FILE>;
     close(FILE);
    foreach $line(@footerfile) {
    print "$line";
    }
    print "</BODY></HTML>";
    }

    d) config.pl
    ========
    Code:
    #!c:\perl\bin\perl.exe
    #!/usr/bin/perl
    
    # You will find a complete HTML tutorial/manual at:
    # http://siteinteractive.com/acctlite/tutorial/
    #
    # Version 1.09
    ##############################################################
    # EDIT USER CONFIGURATIONS BELOW
    # 
    # Note: These are the only configurations you will need to
    # set in Account Manager LITE.
    #
    # Be sure to set the "require" paths in both the acctman.pl
    # and the amadmin.pl files.
    ##############################################################
    
    # Add your BODY tag information, like background graphic, color, etc.
    $bodyspec = "background=\"\" bgcolor=\"#FFFFFF\" link=\"#0000FF\" vlink=\"#0000FF\"";
    
    # Add your own graphics, text, links, etc., to the top of your pages.
    # Give the full directory path to your header.txt file.  DO NOT include
    # the header.txt file in the path here, just the directories.
    # $header = "C:/full/path/to/directory";
    $header = "";
    
    # Add your own graphics, text, links, etc., to the bottom of your pages.
    # Give the full directory path to your footer.txt file.  DO NOT include
    # the footer.txt file in the path here, just the directories.
    # $footer = "C:/full/path/to/directory";
    $footer = "";
    
    # Edit the font colors of the text on the help and error screens that
    # users will see.  This is helpful if you add a background color or
    # graphic.
    $fontcolor = "#000000";
    
    # Type the name of your organization, group, or company
    $orgname = "Account Manager Demo";
    
    # Type an email address that customer/user can respond to
    # Remember to put a backslash \ before your @
    # eg: $orgmail = "whatever\@wherever.com";
    $orgmail = "whatever\@wherever.com";
    
    # Type the full path to your Mail program
    $mailprog = "c:/winnt/system32/blat.exe";
    
    
    
    # This would be the subject of the e-mail your users will
    # receive automatically once they have submitted their
    # application.
    $response_subject = "Application Received";
    
    # If you use .htaccess or .nsconfig, use a "1", otherwise leave blank
    # or set to "0".  This is if you use a secure users area.
    $htaccess = "1";
    
    # If you entered "1" above, enter the full path to your
    # htpasswd or .nsconfig file.
    # Like this: $memaccess = "c:/full/path/to/.htpasswd";
    # This is the file that houses the usernames and encrypted passwords
    # but is only needed if you use .htaccess or .nsconfig
    $memaccess = "c:/full/directory/path/to/info/.htpasswd";
    
    # Type the full path to the database file that contains all the info
    $memberinfo = "c:/full/directory/path/to/info";
    
    
    # Upload the approved.txt, denied.txt, and email.txt files
    # that come with Account Manager to your $memberinfo directory.
    # These files are used to send automatic e-mail responses to
    # your customers/subscribers.  Edit these files as needed.
    
    
    # Type a full path for a temp directory that BLAT Mail can use
    # as well as store other temporary files
    $tempdir = "c:/full/directory/path/to/temp";
    
    
    # Give the full directory path where you would like your password.txt
    # file to be saved.  DO NOT include the name password.txt in the path
    # here, just the directories.  $passfile = "/full/path/to/directory";
    $passfile = "c:/full/directory/path/to/info";
    
    
    # If you are run the script and receive File Locking (flock)
    # errors, remove the number 2 from between the quotes.
    # Then it would appear: $LOCK_EX = "";
    $LOCK_EX = "2";
    
    
    # Type the subject that will appear in the email customer/user
    # receives
    $subject = "ABC Member Info";
    
    
    # Encryption
    # If you are using Apache for Windows, you will want to leave this
    # to the default setting of $crypt = "";
    # If you are using a crypt-capable web server, place a 1 between the
    # quotes, to encrypt your passwords.  
    
    $crypt = "";
    
    
    # Create two text files.  One called "approved.txt" and the other
    # called "denied.txt".  In each, write the response that you would
    # like your prospective members to receive when you have either
    # approved or denied their application for membership, respectively.
    # Then, upload both text files to your $memberinfo directory.
    # The script will do the rest.
    # Example, in the "approved.txt" file, you can type:
    # "Your account is now active."
    
    
    # Subject of email that is automatically sent to users that you
    # chose not to accept in your Account Manager.
    $denied_email_subject = "Application Denied";
    
    # Subject for email that is automatically sent to users that you
    # chose to accept in your Account Manager.
    $approved_email_subject = "Application Approved";
    
    # This is the e-mail Subject for the response that is sent back to
    # you, the administrator, when a signup request is received.
    $signupresponse = "Account Manager Lite Signup Response";
  • numberwhun
    Recognized Expert Moderator Specialist
    • May 2007
    • 3467

    #2
    Reading and understanding the log errors that you get is key.

    This error:

    [Fri Oct 17 00:20:43 2008] [error] [client 127.0.0.1] Can't locate c:/program files/apache software foundation/apache2.2/cgi-bin/config.pl in @INC (@INC contains: C:/perl/site/lib C:/perl/lib .) at D:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/acctman.pl line 75.\r, referer: http://127.0.0.1/amform.html

    seems to be caused by this:

    require "c:/program files/apache software foundation/apache2.2/cgi-bin/config.pl";

    Regards,

    Jeff

    Comment

    • happyse27
      New Member
      • Sep 2008
      • 236

      #3
      Hi Jeff,

      But the config pl is in this cgi-bin directory and the sample script documentation mentioned need to change it. So how to configure this statement? or any alternative?

      Thanks and Best Rgds,
      Andrew

      Comment

      • numberwhun
        Recognized Expert Moderator Specialist
        • May 2007
        • 3467

        #4
        Well, the error is stating that it cannot find that file in either c:/perl/site/lib or c:/perl/lib. You have to remember that when you use "require" or "use", Perl looks to find the modules in one of the directories that are listed in @INC. The files located in those directories are for installed modules. If config.pl were a module, then it would be called config.pm. Unlike other languages where require might be for reading and importing a file, in Perl, it is for telling perl to use a module (as is the use command).

        Since config.pl is actually just a configuration file with a bunch of variables, your best bet may be to redo the file to be an actual config file where it has a layout as such:

        name value
        name value
        name value
        .
        .
        .

        Then, you could read in the file and put it into a hash with the "name" on each line being a key and the value being....well.. ..the value. Its fairly simple and non-trivial to do that, but that's my recommendation.

        Regards,

        Jeff

        Comment

        • KevinADC
          Recognized Expert Specialist
          • Jan 2007
          • 4092

          #5
          He has Apache installed on the D drive but the "require" call (line 75 acctman.pl) is to the C drive.

          Comment

          • happyse27
            New Member
            • Sep 2008
            • 236

            #6
            Hi Jeff,

            I tried but cant work for the method, and reverted back. Not sure if I implemented wrongly or not...


            Hi Kevin,

            Thanks! You are very sharp!. I changed the c drive of apache to d drive and it didnt complaint. But I got other new error below. Not sure how to configure the email thing below and how to path the directory?


            Kindly assist. Cheers...


            Andrew


            new apache error log
            ===============
            [Sat Oct 18 04:41:41 2008] [error] [client 127.0.0.1] Premature end of script headers: acctman.pl, referer: http://127.0.0.1/amform.html
            [Sat Oct 18 04:41:41 2008] [error] [client 127.0.0.1] Cannot open c:/full/directory/path/to/temp\\h@hotmail .com -- Check Directory Permissions : No such file or directory at D:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/acctman.pl line 218.\r, referer: http://127.0.0.1/amform.html

            Comment

            • happyse27
              New Member
              • Sep 2008
              • 236

              #7
              Hi All,

              Sorry, I changed to c:/full/directory/path/to/temp from d drive and it didnt complain anymore.

              However I got new error below.

              Not sure really how to resolve this for this time round. Thanks in advance...


              Thanks in advance,
              Andrew

              apache error
              =========
              [Sat Oct 18 04:51:11 2008] [error] [client 127.0.0.1] Premature end of script headers: acctman.pl, referer: http://127.0.0.1/amform.html
              [Sat Oct 18 04:51:11 2008] [error] [client 127.0.0.1] Died at D:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/acctman.pl line 254.\r, referer: http://127.0.0.1/amform.html

              Comment

              • KevinADC
                Recognized Expert Specialist
                • Jan 2007
                • 4092

                #8
                line 245 acctman.pl

                Code:
                Win32::Process::Create($ProcessObj, $mailprog, "Blat $tempdir\\$INPUT{'email'} -t $INPUT{'email'} -s \"$response_subject\" -i \"$orgmail ($orgname)\" ", 0, DETACHED_PROCESS, ".")|| die ;
                Is Blat installed on your computer?



                Note, the script acctman.pl is 10 years old! It looks poorly written. It may not work anymore being that old and running on newer versions of perl and newer versions of Windows.

                Comment

                • happyse27
                  New Member
                  • Sep 2008
                  • 236

                  #9
                  Hi Kevin,

                  Thanks again. I just want a minimal round of testing to make sure that it acctman.pl.

                  I will try to take out the emailing portion and also what is the way to reduce the scripts so that I can make it easily workable?

                  Also, the acctman.pl can I specific which version of perl to use? Or there are some newer version of acctman.pl itself?


                  Thanks again,
                  Andrew

                  Comment

                  • happyse27
                    New Member
                    • Sep 2008
                    • 236

                    #10
                    Hi Kevin,

                    Typo- error, Thanks again. I just want a minimal round of testing to make sure that it works for acctman.pl.

                    Thanks,
                    Andrew

                    Comment

                    • KevinADC
                      Recognized Expert Specialist
                      • Jan 2007
                      • 4092

                      #11
                      Originally posted by happyse27
                      Hi Kevin,

                      Typo- error, Thanks again. I just want a minimal round of testing to make sure that it works for acctman.pl.

                      Thanks,
                      Andrew
                      OK, but I am not interested in helping to modify that script. If I were you I would search for something newer.

                      Comment

                      Working...