By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,426 Members | 3,152 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,426 IT Pros & Developers. It's quick & easy.

apache error when interfacing html with perl

100+
P: 236
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
==========

Expand|Select|Wrap|Line Numbers
  1.  
  2. <!DOCTYPE HTML PUBLIC "-//SoftQuad//DTD HTML 3.2 + extensions for HoTMetaL PRO 3.0(U) 19961211//EN"
  3.  "hmpro3.dtd">
  4. <HTML>
  5. <HEAD>
  6. <TITLE></TITLE></HEAD>
  7. <BODY>
  8. <FORM ACTION="/cgi-bin/acctman.pl" METHOD="POST">
  9. <CENTER>
  10. <TABLE BORDER="0" WIDTH="400">
  11. <TR>
  12. <TD ALIGN="CENTER">
  13. <TABLE BORDER="0" CELLPADDING="5" BGCOLOR="#FF8000">
  14. <TR>
  15. <TD><INPUT TYPE="CHECKBOX" NAME="agree" VALUE="agree"></TD>
  16. <TD><FONT SIZE="-1" FACE="verdana, arial, helvetica"><B>I agree to the Terms 
  17. and Conditions above.</B></FONT></TD></TR></TABLE><BR></TD></TR>
  18. <TR>
  19. <TD>
  20. <HR SIZE="2" NOSHADE="NOSHADE"></TD></TR>
  21. <TR>
  22. <TD ALIGN="CENTER">
  23. <TABLE BORDER="0" WIDTH="350" NOWRAP="NOWRAP">
  24. <TR>
  25. <TD><FONT SIZE="-1" FACE="verdana, arial, helvetica"><B>Customer Information</B></FONT><BR><FONT
  26. SIZE="-2" FACE="verdana, arial, helvetica" COLOR="#FF0000"><B>Fields marked 
  27. with an astriks<BR>are required input fields.</B></FONT><BR><BR></TD></TR>
  28. <TR>
  29. <TD><INPUT TYPE="TEXT" NAME="fname">
  30. <FONT SIZE="-1" FACE="verdana, arial, helvetica">First Name *</FONT></TD></TR>
  31. <TR>
  32. <TD><INPUT TYPE="TEXT" NAME="lname">
  33. <FONT SIZE="-1" FACE="verdana, arial, helvetica">Last Name *</FONT></TD></TR>
  34. <TR>
  35. <TD><INPUT TYPE="TEXT" NAME="email">
  36. <FONT SIZE="-1" FACE="verdana, arial, helvetica">E-Mail Address *</FONT></TD></TR></TABLE>
  37. <TABLE BORDER="0" WIDTH="350" NOWRAP="NOWRAP">
  38. <TR>
  39. <TD><BR><FONT SIZE="-1" FACE="verdana, arial, helvetica"><B>Choose a User 
  40. Name</B></FONT><BR><INPUT TYPE="TEXT" NAME="username"> 
  41. <FONT SIZE="-1" FACE="verdana, arial, helvetica">User Name</FONT>  
  42. <FONT SIZE="-1" FACE="arial, helvetica"><BR><BR><B>Choose a Password</B></FONT><BR>
  43.  
  44. <INPUT TYPE="password" NAME="pwd">     
  45. <FONT SIZE="-1" FACE="verdana, arial, helvetica">Password</FONT><BR><INPUT
  46. TYPE="password" NAME="pwd2"> <FONT SIZE="-1" FACE="verdana, arial, helvetica">Verify
  47.   Password</FONT></TD></TR></TABLE><BR><BR><INPUT
  48. TYPE="SUBMIT" NAME="process" VALUE="Submit My Order"><INPUT
  49. TYPE="RESET" NAME=""></TD></TR>
  50. <TR>
  51. <TD>
  52. <HR SIZE="2" NOSHADE="NOSHADE"></TD></TR></TABLE></CENTER></FORM></BODY></HTML>
  53.  
  54.  


c) acctman.pl
==========
Expand|Select|Wrap|Line Numbers
  1. #!c:\perl\bin\perl.exe
  2. #!/usr/bin/perl
  3. ############################################
  4. ##                                        ##
  5. ##     Account Manager LITE User Signup   ##
  6. ##          by SiteInteractive.com        ##
  7. ##    http://siteinteractive.com/contact  ##
  8. ##                                        ##
  9. ##             version:  1.09             ##
  10. ##       last modified:  07/24/2002       ##
  11. ##        copyright (c) 1998 - 2002       ##
  12. ##                                        ##
  13. ##    latest version is available from    ##
  14. ##        http://SiteInteractive.com      ##
  15. ##                                        ##
  16. ############################################
  17. #
  18. # Copyright 1998 Elite Host.  All Rights Reserved.
  19. #
  20. # TERMS OF USE 
  21. # 1. Account Manager is for licensed customers
  22. # only. Customer may use Account Manager as many
  23. # times as customer wishes, as long as customer owns or runs the web
  24. # site that Account Manager is installed on.  Account
  25. # Manager may not under any circumstances be sold
  26. # or redistributed without the written consent of CGI Script Center and
  27. # its owner Diran Alemshah.
  28. #
  29. # 2. CGI Script Center, at its own discresion, will decide if any terms 
  30. # of the this agreement have been violated by customer. Upon written e-
  31. # mailed notification to Customer of Terms of Use violations, CGI
  32. # Script Center may revoke customer's license to use Account Manager.
  33. # In that event, Customer agrees to any and all of the following:
  34. #
  35. # a) Customers found in violation of this agreement, found reselling or
  36. # redistributing Account Manager, or making 
  37. # Customers Members Area ID and password public to anyone in any 
  38. # manner will forfeit their Members area password and all rights to 
  39. # future versions of Account Manager.
  40. # b). Customer will no longer be licensed to run any version of 
  41. # Account Manager. 
  42. #
  43. # Indemnification
  44. # 1. Customer agrees that it shall defend, indemnify, save and hold
  45. # CGI Script Center, Elite Web Design and marketing, and any
  46. # persons affiliated with either company, harmless from any and all
  47. # demands, liabilities, losses, costs and claims, including reasonable
  48. # attorney's fees asserted against CGI Script Center, its agents, its
  49. # customers, officers and employees, that may arise or result from any
  50. # service provided or performed or agreed to be performed or any product
  51. # sold by customer, its agents, employees or assigns. Customer agrees to
  52. # defend, indemnify and hold harmless CGI Script Center, its agents,
  53. # its cusomters, officers, and employes,against
  54. # liabilities arising out of; a) any injury to person or property caused
  55. # by an products sold or  otherwise distributed in connection with CGI
  56. # Script Center products; (b) any material supplied by customer
  57. # infringing or allegedly infringing on the proprietary rights of a
  58. # third party; c) copyright infringement and (d) any defective products
  59. # sold to customer from CGI Script Center products.
  60. #
  61. # This program may not be distributed in whole or part, freely, for pay, 
  62. # or any other form of compensation.
  63. #
  64. #################################################################
  65. # This version designed for Win32 systems (NT).  If you require
  66. # a Unix version, please contact cgi@elitehost.com
  67. #################################################################
  68.  
  69.  
  70. ##############################################################
  71. # EDIT USER CONFIGURATIONS BELOW
  72. ##############################################################
  73.  
  74. require "c:/program files/apache software foundation/apache2.2/cgi-bin/config.pl";
  75.  
  76. # This completes this portion of your Account Manager setup
  77. ##############################################################
  78. # DO NOT EDIT BELOW THIS LINE
  79. ##############################################################
  80.  
  81. read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
  82. @pairs = split(/&/, $buffer);
  83. foreach $pair (@pairs) {
  84.     ($name, $value) = split(/=/, $pair);
  85.     $value =~ tr/+/ /;
  86.     $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
  87.     if ($INPUT{$name}) { $INPUT{$name} = $INPUT{$name}.",".$value; }
  88.     else { $INPUT{$name} = $value; }
  89.       $value =~ s/<!--(.|\n)*-->//g;
  90. }
  91.  
  92. $version = "1.08";
  93.  
  94. $cgiurl = $ENV{'SCRIPT_NAME'};
  95.  
  96. if ($INPUT{'find'}) { &find; } ######### Will search for member info.
  97. if ($INPUT{'process'}) { &sorder; } 
  98. #elsif ($INPUT{'order'}) { &order; }
  99. #elsif ($INPUT{'sorder'}) {&sorder; } 
  100. else {&sorder;}############# IF no button was pressed, run just as 
  101. exit;
  102.  
  103.  
  104. sub sorder {
  105.  
  106. unless ($INPUT{'agree'}) {
  107. print "Content-type: text/html\n\n";
  108. &header;
  109. print<<EOF;
  110. <CENTER><BR>
  111. <TABLE BORDER="0" WIDTH="400"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR><TD
  112. COLSTART="1"><CENTER><P><B><FONT FACE="verdana, arial, helvetica"><FONT
  113. COLOR="#FF0000">Account Manager</FONT> Status:<BR>You Must Agree.</FONT></B></P></CENTER>
  114. <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>
  115. <P><FONT SIZE="-1" COLOR="$fontcolor" FACE="verdana, arial, helvetica">If you need further
  116. assistance, please contact <A HREF="mailto:$orgmail">$orgname Support</A>.</FONT></P>
  117. <CENTER><TABLE BORDER="0" WIDTH="400"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR
  118. ><TD COLSTART="1"><HR SIZE="1">
  119. <CENTER><FONT SIZE="-2" FACE="verdana, arial, helvetica">$orgname
  120. maintained with <B><A HREF="http://cgi.elitehost.com/">Account Manager $version</A></B></FONT> 
  121. </CENTER></TD></TR></ROWS></TBODY></TABLE></CENTER></TD></TR></ROWS></TBODY></TABLE></CENTER>
  122. EOF
  123. &footer;
  124. exit;
  125. }
  126.  
  127.  
  128. unless ($INPUT{'fname'}) {
  129. print "Content-type: text/html\n\n";
  130. &header;
  131. print<<EOF;
  132. <CENTER><BR>
  133. <TABLE BORDER="0" WIDTH="400"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR><TD
  134. COLSTART="1"><CENTER><P><B><FONT FACE="verdana, arial, helvetica"><FONT
  135. COLOR="#FF0000">Account Manager</FONT> Status:<BR>Please Enter Your First Name.</FONT></B></P></CENTER>
  136. <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>
  137. <P><FONT SIZE="-1" COLOR="$fontcolor" FACE="verdana, arial, helvetica">If you need further
  138. assistance, please contact <A HREF="mailto:$orgmail">$orgname Support</A>.</FONT></P>
  139. <CENTER><TABLE BORDER="0" WIDTH="400"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR
  140. ><TD COLSTART="1"><HR SIZE="1">
  141. <CENTER><FONT SIZE="-2" FACE="verdana, arial, helvetica">$orgname
  142. maintained with <B><A HREF="http://cgi.elitehost.com/">Account Manager $version</A></B></FONT> 
  143. </CENTER></TD></TR></ROWS></TBODY></TABLE></CENTER></TD></TR></ROWS></TBODY></TABLE></CENTER>
  144. EOF
  145. &footer;
  146. exit;
  147. }
  148.  
  149. unless ($INPUT{'lname'}) {
  150. print "Content-type: text/html\n\n";
  151. &header;
  152. print<<EOF;
  153. <CENTER><BR>
  154. <TABLE BORDER="0" WIDTH="400"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR><TD
  155. COLSTART="1"><CENTER><P><B><FONT FACE="verdana, arial, helvetica"><FONT
  156. COLOR="#FF0000">Account Manager</FONT> Status:<BR>Please Enter Your Last Name.</FONT></B></P></CENTER>
  157. <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>
  158. <P><FONT SIZE="-1" COLOR="$fontcolor" FACE="verdana, arial, helvetica">If you need further
  159. assistance, please contact <A HREF="mailto:$orgmail">$orgname Support</A>.</FONT></P>
  160. <CENTER><TABLE BORDER="0" WIDTH="400"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR
  161. ><TD COLSTART="1"><HR SIZE="1">
  162. <CENTER><FONT SIZE="-2" FACE="verdana, arial, helvetica">$orgname
  163. maintained with <B><A HREF="http://cgi.elitehost.com/">Account Manager $version</A></B></FONT> 
  164. </CENTER></TD></TR></ROWS></TBODY></TABLE></CENTER></TD></TR></ROWS></TBODY></TABLE></CENTER>
  165. EOF
  166. &footer;
  167. exit;
  168. }
  169.  
  170.  
  171.  
  172. $INPUT{'email'} =~ s/\s//g;
  173.  
  174. unless ($INPUT{'email'} =~ /(@.*@)|(\.\.)|(@\.)|(^\.)|(,)|(\/)|(\:)/
  175.       || $INPUT{'email'} !~
  176.       /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/)
  177.       {
  178.          $legalemail = 1;
  179.         } else {
  180.          $legalemail = 0;
  181.         }
  182.  
  183.  
  184. if ($legalemail !~ 1) {
  185. print "Content-type: text/html\n\n";
  186. &header;
  187. print<<EOF;
  188. <CENTER><BR>
  189. <TABLE BORDER="0" WIDTH="400"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR><TD
  190. COLSTART="1"><CENTER><P><B><FONT FACE="verdana, arial, helvetica"><FONT
  191. COLOR="#FF0000">Account Manager</FONT> Status:<BR>Please Enter Your E-Mail Address.</FONT></B></P></CENTER>
  192. <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>
  193. <P><FONT SIZE="-1" COLOR="$fontcolor" FACE="verdana, arial, helvetica">If you need further
  194. assistance, please contact <A HREF="mailto:$orgmail">$orgname Support</A>.</FONT></P>
  195. <CENTER><TABLE BORDER="0" WIDTH="400"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR
  196. ><TD COLSTART="1"><HR SIZE="1">
  197. <CENTER><FONT SIZE="-2" FACE="verdana, arial, helvetica">$orgname
  198. maintained with <B><A HREF="http://cgi.elitehost.com/">Account Manager $version</A></B></FONT> 
  199. </CENTER></TD></TR></ROWS></TBODY></TABLE></CENTER></TD></TR></ROWS></TBODY></TABLE></CENTER>
  200. EOF
  201. &footer;
  202. exit;
  203. }
  204.  
  205.  
  206. &add;
  207. }
  208.  
  209.  
  210.  
  211. sub close {
  212.  
  213. open (FILE,"$memberinfo/email.txt"); #### Full path name from root.
  214. @closing  = <FILE>;
  215. close(FILE);
  216.  
  217. open(MAIL,">$tempdir\\$INPUT{'email'}") || die("Cannot open $tempdir\\$INPUT{'email'} -- Check Directory Permissions : $!"); 
  218.  
  219.     print MAIL "To: $INPUT{'email'}\n";
  220.     print MAIL "From: $orgmail ($orgname)\n";
  221.     print MAIL "Subject: $response_subject\n";
  222.     print MAIL "-" x 75 . "\n\n";
  223.  
  224.  
  225.  
  226.  
  227.     foreach $line(@closing) {
  228.     $line =~ s/<FIRST_NAME>/$INPUT{'fname'}/g;
  229.     $line =~s/<LAST_NAME>/$INPUT{'lname'}/g;
  230.     $line =~ s/<USERNAME>/$INPUT{'username'}/g;
  231.     $line =~s/<PASSWORD>/$INPUT{'pwd'}/g;
  232.     $line =~s/<ORGNAME>/$orgname/g;
  233.     $line =~s/<ORGMAIL>/$orgmail/g;
  234.     print MAIL "$line";
  235.     }
  236.  
  237.     print MAIL"\n\n";
  238.     close (MAIL);
  239.  
  240.  
  241.  
  242.         #'use' the process module.
  243.         use Win32::Process;
  244.  
  245.         #theWin32:: module. Includes the Win32 error checking etc.
  246.         # see Win32:: section for included functions.
  247.         use Win32;
  248.  
  249.         #sub Error{ 
  250.         #print Win32::FormatMessage( Win32::GetLastError() );
  251.         #}
  252.         #Create the process object.
  253.         Win32::Process::Create($ProcessObj, $mailprog, "Blat $tempdir\\$INPUT{'email'} -t $INPUT{'email'} -s \"$response_subject\" -i \"$orgmail ($orgname)\" ", 0, DETACHED_PROCESS, ".")|| die ; 
  254.         #Set the process priority
  255.         #$ProcessObj->SetPriority(NORMAL_PRIORITY_CLASS)||die ;
  256.  
  257.         #Wait for the process to end. NO timeout 
  258.         $ProcessObj->Wait(INFINITE);
  259.         unlink("$tempdir\\$INPUT{'email'}");
  260.  
  261.  
  262.  
  263. #################################################################
  264. ## MAIL BACK TO ADMIN ###########################################
  265. #################################################################
  266.  
  267. open(MAIL,">$tempdir\\$orgmail") || die("Cannot open $tempdir\\$orgmail -- Check Directory Permissions : $!"); 
  268.  
  269.     print MAIL "To: $orgmail\n";
  270.     print MAIL "From: $INPUT{'email'} ($INPUT{'fname'} $INPUT{'lname'})\n";
  271.     print MAIL "Subject: $signupresponse\n";
  272.     print MAIL "-" x 75 . "\n\n";
  273.  
  274.     print MAIL "Customer Information\n";
  275.     print MAIL "-" x 75 . "\n\n";
  276.     print MAIL "Name: $INPUT{'fname'} $INPUT{'lname'}\n";
  277.     print MAIL "Email: $INPUT{'email'}\n\n";
  278.  
  279.  
  280.  
  281.  
  282.     close (MAIL);
  283.  
  284.  
  285.  
  286.         #'use' the process module.
  287.         use Win32::Process;
  288.  
  289.         #theWin32:: module. Includes the Win32 error checking etc.
  290.         # see Win32:: section for included functions.
  291.         use Win32;
  292.  
  293.         #sub Error{ 
  294.         #print Win32::FormatMessage( Win32::GetLastError() );
  295.         #}
  296.         #Create the process object.
  297.         Win32::Process::Create($ProcessObj, $mailprog, "Blat $tempdir\\$orgmail -t $orgmail -s \"$signupresponse\" -i \"$INPUT{'email'} ($INPUT{'fname'} $INPUT{'lname'})\" ", 0, DETACHED_PROCESS, ".")|| die ; 
  298.         #Set the process priority
  299.         #$ProcessObj->SetPriority(NORMAL_PRIORITY_CLASS)||die ;
  300.  
  301.         #Wait for the process to end. NO timeout 
  302.         $ProcessObj->Wait(INFINITE);
  303.         unlink("$tempdir\\$orgmail");
  304.  
  305.  
  306.  
  307.  
  308. print "Content-type: text/html\n\n";
  309. &header;
  310. print<<EOF;
  311. <CENTER><BR>
  312. <TABLE BORDER="0" WIDTH="400"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR><TD
  313. COLSTART="1"><P><B><FONT FACE="verdana, arial, helvetica"><FONT
  314. COLOR="#FF0000">Account
  315. Manager</FONT> Status:  Success!</FONT></B></P>
  316. <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>
  317. <P><FONT SIZE="-1" COLOR="$fontcolor" FACE="verdana, arial, helvetica">Please contact
  318. <A HREF="mailto:$orgmail">$orgname Support</A> if you
  319. need any further assistance.</FONT></P>
  320. <HR SIZE="1">
  321. <CENTER><FONT SIZE=\"-2\" FACE=\"verdana, arial, helvetica\"> $orgname is maintained with  <A
  322. HREF=\"http://cgi.elitehost.com\"><B>Account Manager $version</B></A></FONT>
  323. </CENTER> 
  324. </TD></TR></ROWS></TBODY></TABLE></CENTER>
  325. EOF
  326. &footer;
  327. exit;
  328. }
  329.  
  330. #}
  331.  
  332. sub checkaddress {
  333.  
  334. $INPUT{'email'} =~ s/\s//g;
  335.  
  336. unless ($INPUT{'email'} =~ /(@.*@)|(\.\.)|(@\.)|(^\.)|(,)|(\/)|(\:)/
  337.       || $INPUT{'email'} !~
  338.       /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/)
  339.       {
  340.          $legalemail = 1;
  341.         } else {
  342.          $legalemail = 0;
  343.         }
  344.  
  345.  
  346. if ($legalemail !~ 1) {
  347. print "Content-type: text/html\n\n";
  348. &header;
  349. print<<EOF;
  350. <CENTER><BR>
  351. <TABLE BORDER="0" WIDTH="400"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR><TD
  352. COLSTART="1"><CENTER><P><B><FONT FACE="verdana, arial, helvetica"><FONT
  353. COLOR="#FF0000">Account Manager</FONT> Status:<BR>Please Enter Your E-Mail Address.</FONT></B></P></CENTER>
  354. <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>
  355. <P><FONT SIZE="-1" COLOR="$fontcolor" FACE="verdana, arial, helvetica">If you need further
  356. assistance, please contact <A HREF="mailto:$orgmail">$orgname Support</A>.</FONT></P>
  357. <CENTER><TABLE BORDER="0" WIDTH="400"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR
  358. ><TD COLSTART="1"><HR SIZE="1">
  359. <CENTER><FONT SIZE="-2" FACE="verdana, arial, helvetica">$orgname
  360. maintained with <B><A HREF="http://cgi.elitehost.com/">Account Manager $version</A></B></FONT> 
  361. </CENTER></TD></TR></ROWS></TBODY></TABLE></CENTER></TD></TR></ROWS></TBODY></TABLE></CENTER>
  362. EOF
  363. &footer;
  364. exit;
  365. }
  366. }
  367.  
  368. sub find {
  369.  
  370. &checkaddress;
  371.  
  372. # Open member database, read info
  373. open (DAT,"<$memberinfo/amdata.db");
  374. if ($LOCK_EX){ 
  375.       flock(DAT, $LOCK_EX); #Locks the file
  376.     }
  377.  @database_array = <DAT>;
  378.  close (DAT);
  379.  
  380. foreach $lines(@database_array) {
  381.           @edit_array = split(/\:/,$lines);
  382.  
  383. &parseemail;
  384. # if ($edit_array[2] =~ /$INPUT{'email'}/i) {last; }
  385.  
  386. if ($edit_array[2] eq $email) {last; }
  387.  
  388. }
  389.  
  390. # unless ($edit_array[2] =~ /$INPUT{'email'}/i) {
  391.  
  392. unless ($edit_array[2] eq $email) {
  393.  
  394. print "Content-type: text/html\n\n";
  395. &header;
  396. print "<CENTER><BR><TABLE
  397. BORDER=\"0\" WIDTH=\"450\"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR><TD
  398. COLSTART=\"1\"><P><B><FONT FACE=\"verdana, arial, helvetica\"><FONT
  399. COLOR=\"#FF0000\">Account Manager</FONT> Status:  Not Found!</FONT></B></P><P><FONT
  400. 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
  401. SIZE=\"-1\" COLOR=\"$fontcolor\" FACE=\"verdana, arial, helvetica\">Please contact <A
  402. HREF=\"mailto:$orgmail\">$orgname Support</A> for your account information.</FONT></P><HR
  403. SIZE=\"1\"><CENTER><FONT SIZE=\"-2\" FACE=\"verdana, arial, helvetica\"> $orgname is maintained with  <A
  404. HREF=\"http://cgi.elitehost.com\"><B>Account Manager $version</B></A></FONT>
  405. </CENTER></TD></TR></ROWS></TBODY></TABLE></CENTER>";
  406. &footer;
  407. exit;
  408.  
  409. print "Content-type: text/html\n\n";
  410. &header;
  411. print "<CENTER><BR><TABLE
  412. BORDER=\"0\" WIDTH=\"450\"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR><TD
  413. COLSTART=\"1\"><P><B><FONT FACE=\"verdana, arial, helvetica\"><FONT
  414. COLOR=\"#FF0000\">Account Manager</FONT> Status:  Success!</FONT></B></P><P><FONT
  415. SIZE=\"-1\" COLOR=\"$fontcolor\" FACE=\"verdana, arial, helvetica\">Your $orgname account information has been emailed to you at: $INPUT{'email'}.</FONT></P><P><FONT
  416. SIZE=\"-1\" COLOR=\"$fontcolor\" FACE=\"verdana, arial, helvetica\">Please contact <A
  417. HREF=\"mailto:$orgmail\">$orgname Support</A> if you need any further assistance.</FONT></P><HR
  418. SIZE=\"1\"><CENTER><FONT SIZE=\"-2\" FACE=\"verdana, arial, helvetica\"> $orgname is maintained with  <A
  419. HREF=\"http://cgi.elitehost.com\"><B>Account Manager $version</B></A></FONT>
  420. </CENTER></TD></TR></ROWS></TBODY></TABLE></CENTER>";
  421. &footer;
  422.  
  423. # Output a temporary file
  424.  
  425.     open(MAIL,">$tempdir\\$edit_array[2]") || die("Cannot open $tempdir\\$edit_array[2] -- Check Directory Permissions : $!"); 
  426.  
  427.     print MAIL "To: $edit_array[2]\n";
  428.     print MAIL "From: $orgmail ($orgname Support)\n";
  429.  
  430.     #Date
  431.     print MAIL "$date\n";
  432.  
  433.     # Check for Message Subject
  434.     print MAIL "Subject: $orgname Account Information\n\n";
  435.     print MAIL "-" x 75 . "\n\n";
  436.  
  437.     print MAIL "You requested your $orgname account information:\n\n";
  438.  
  439.     print MAIL "Your $orgname User ID is: $edit_array[0]\n";
  440.     print MAIL "Your $orgname password is: $edit_array[1]\n\n";
  441.  
  442.     print MAIL "please contact $orgname support at: $orgmail\n";
  443.     print MAIL "if you have any questions.\n\n";
  444.  
  445.     print MAIL "$orgname Support Team\n";    
  446.  
  447.     close (MAIL);
  448.  
  449.         #'use' the process module.
  450.         use Win32::Process;
  451.  
  452.         #theWin32:: module. Includes the Win32 error checking etc.
  453.         # see Win32:: section for included functions.
  454.         use Win32;
  455.  
  456.         #sub Error{ 
  457.         #print Win32::FormatMessage( Win32::GetLastError() );
  458.         #}
  459.         #Create the process object.
  460.         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 ; 
  461.         #Set the process priority
  462.         #$ProcessObj->SetPriority(NORMAL_PRIORITY_CLASS)||die ;
  463.  
  464.         #Wait for the process to end. NO timeout 
  465.         $ProcessObj->Wait(INFINITE);
  466.         unlink("$tempdir\\$edit_array[2]");
  467.  
  468. exit;
  469.  
  470. }
  471.  
  472. sub add {
  473.  
  474.  
  475. unless ($INPUT{'username'}) {
  476. print "Content-type: text/html\n\n";
  477. &header;
  478. print "<CENTER><TABLE BORDER=\"0\" WIDTH=\"450\"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR
  479. ><TD ALIGN=\"CENTER\" COLSTART=\"1\">     
  480. <FONT SIZE=\"+1\" FACE=\"verdana, arial, helvetica\"><FONT COLOR=\"#FF0000\">Account
  481. Manager:</FONT><BR>Account Information Input Form</FONT><BR><BR>
  482. <TABLE BORDER=\"0\"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR><TD
  483. ALIGN=\"LEFT\" COLSTART=\"1\"><FONT SIZE=\"+1\" COLOR=\"$fontcolor\" FACE=\"verdana, arial, helvetica\"><B>Username
  484. Error!  No Username</B></FONT><BR><BR><FONT
  485. SIZE=\"-1\" FACE=\"verdana, arial, helvetica\">Please go back and a Username.</FONT></TD></TR><TR><TD COLSTART=\"1\"><HR SIZE=\"1\">
  486. <CENTER><FONT SIZE=\"-2\" FACE=\"verdana, arial, helvetica\"> $orgname is maintained with  <A
  487. HREF=\"http://cgi.elitehost.com\"><B>Account Manager $version</B></A></FONT>
  488. </CENTER> </TD></TR></ROWS></TBODY></TABLE></TD></TR></ROWS></TBODY></TABLE></CENTER>";
  489. &footer;
  490. exit;
  491.     } 
  492.  
  493.  
  494.  
  495.  
  496. if ($INPUT{'username'} =~ /\s/) {
  497. print "Content-type: text/html\n\n";
  498. &header;
  499. print "<CENTER><TABLE BORDER=\"0\" WIDTH=\"450\"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR
  500. ><TD ALIGN=\"CENTER\" COLSTART=\"1\">     
  501. <FONT SIZE=\"+1\" FACE=\"verdana, arial, helvetica\"><FONT COLOR=\"#FF0000\">Account
  502. Manager:</FONT><BR>Account Information Input Form</FONT><BR><BR>
  503. <TABLE BORDER=\"0\"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR><TD
  504. ALIGN=\"LEFT\" COLSTART=\"1\"><FONT SIZE=\"+1\" COLOR=\"$fontcolor\" FACE=\"verdana, arial, helvetica\"><B>Username
  505. Error!  Username Contains a Space</B></FONT><BR><BR><FONT
  506. 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\">
  507. <CENTER><FONT SIZE=\"-2\" COLOR=\"$fontcolor\" FACE=\"verdana, arial, helvetica\"> $orgname is maintained with  <A
  508. HREF=\"http://cgi.elitehost.com\"><B>Account Manager $version</B></A></FONT>
  509. </CENTER> </TD></TR></ROWS></TBODY></TABLE></TD></TR></ROWS></TBODY></TABLE></CENTER>";
  510. &footer;
  511. exit;
  512.     }
  513.  
  514. if ($INPUT{'username'} eq $INPUT{'pwd'}) {
  515.  
  516. print "Content-type: text/html\n\n";
  517. &header;
  518. print "<CENTER><TABLE BORDER=\"0\" WIDTH=\"450\"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR
  519. ><TD ALIGN=\"CENTER\" COLSTART=\"1\">     
  520. <FONT SIZE=\"+1\" FACE=\"verdana, arial, helvetica\"><FONT COLOR=\"#FF0000\">Account Manager:</FONT><BR>  Account Information Input Form</FONT><BR><BR>
  521. <TABLE BORDER=\"0\"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR><TD
  522. ALIGN=\"LEFT\" COLSTART=\"1\"><FONT SIZE=\"+1\" COLOR=\"$fontcolor\" FACE=\"verdana, arial, helvetica\"><B>Password Error!  Same as Username</B></FONT><BR><BR><FONT
  523. 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>
  524.  
  525. </ROWS></TBODY></TABLE></TD></TR></ROWS></TBODY></TABLE></CENTER>";
  526. &footer;
  527. exit;
  528. }
  529.  
  530. unless ($INPUT{'pwd'} eq $INPUT{'pwd2'} && $INPUT{'pwd'} && $INPUT{'pwd2'} ){
  531.  
  532. print "Content-type: text/html\n\n";
  533. &header;
  534. print "<CENTER><TABLE BORDER=\"0\" WIDTH=\"450\"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR
  535. ><TD ALIGN=\"CENTER\" COLSTART=\"1\">     
  536. <FONT SIZE=\"+1\" FACE=\"verdana, arial, helvetica\"><FONT COLOR=\"#FF0000\">Account
  537. Manager:</FONT><BR>Account Information Input Form</FONT><BR><BR>
  538. <TABLE BORDER=\"0\"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR><TD
  539. ALIGN=\"LEFT\" COLSTART=\"1\"><FONT SIZE=\"+1\" COLOR=\"$fontcolor\" FACE=\"verdana, arial, helvetica\"><B>Password
  540. Error!  Password Mismatch</B></FONT><BR><BR><FONT
  541. SIZE=\"-1\" FACE=\"verdana, arial, helvetica\">Please go back and re-enter your
  542. password choice.</FONT></TD></TR><TR><TD COLSTART=\"1\"><HR SIZE=\"1\">
  543. <CENTER><FONT SIZE=\"-2\" FACE=\"verdana, arial, helvetica\"> $orgname is maintained with  <A
  544. HREF=\"http://cgi.elitehost.com\"><B>Account Manager $version</B></A></FONT>
  545. </CENTER> </TD></TR></ROWS></TBODY></TABLE></TD></TR></ROWS></TBODY></TABLE></CENTER>";
  546. &footer;
  547. exit;
  548.     } 
  549.  
  550.  
  551. if (-e "$memberinfo/amdata.db") {
  552.  
  553. open (MEMBER, "<$memberinfo/amdata.db");
  554. if ($LOCK_EX){ 
  555.       flock(MEMBER, $LOCK_EX); #Locks the file
  556.     }
  557. @database_array = <MEMBER>;
  558.  close (MEMBER);
  559.  
  560. foreach $lines(@database_array) {
  561.           @edit_array = split(/\:/,$lines);
  562.     &parseusername2;
  563.  
  564. #    if ($edit_array[0] eq $INPUT{'username'}) {last; }
  565.  
  566. if (($edit_array[0]) && ($edit_array[0] eq $desiredname)) {last; }
  567.  
  568. }
  569.  
  570. $INPUT{'username'} =~ s/\W.*//;
  571. # if ($edit_array[0] eq $INPUT{'username'}) {
  572.  
  573. if (($edit_array[0]) && ($edit_array[0] eq $desiredname)) {
  574.  
  575. print "Content-type: text/html\n\n";
  576. &header;
  577. print "<CENTER><TABLE BORDER=\"0\" WIDTH=\"450\"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR
  578. ><TD ALIGN=\"CENTER\" COLSTART=\"1\">     
  579. <FONT SIZE=\"+1\" FACE=\"verdana, arial, helvetica\"><FONT COLOR=\"#FF0000\">Account Manager:</FONT><BR>User Name Taken</FONT><BR><BR>
  580. <TABLE BORDER=\"0\"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR><TD
  581. ALIGN=\"LEFT\" COLSTART=\"1\"><FONT SIZE=\"+1\" FACE=\"verdana, arial, helvetica\"><B>User Name Error!  User Name Taken</B></FONT><BR><BR><FONT
  582. 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>
  583. <TR><TD COLSTART=\"1\"><HR SIZE=\"1\">
  584. <CENTER><FONT SIZE=\"-2\" FACE=\"verdana, arial, helvetica\"> $orgname is maintained with  <A
  585. HREF=\"http://cgi.elitehost.com\"><B>Account Manager $version</B></A></FONT>
  586. </CENTER></TD></TR></ROWS></TBODY></TABLE></TD></TR></ROWS></TBODY></TABLE></CENTER>";
  587. &footer;
  588. exit;
  589. }
  590.  
  591.  
  592. }
  593. &dupeaddress;
  594. &dupeaddress2;
  595. &usertemp;
  596. #&dupepwd;
  597. &temp;
  598. exit;
  599. }
  600.  
  601. sub usertemp {
  602.  
  603.  
  604. opendir (DIR, "$memberinfo"); 
  605. @file = grep { /.infotmp/} readdir(DIR);
  606. foreach $lines(@file) {
  607.  $lines =~ s/\W.*//;
  608.  
  609. &parseusername;
  610.  
  611. if ($lines eq $desiredname) {
  612.  
  613. # if ($lines =~ /$INPUT{'username'}\b/i) {
  614. print "Content-type: text/html\n\n";
  615. &header; 
  616. print<<EOF;
  617. <CENTER><BR>
  618. <TABLE BORDER="0" WIDTH="450"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR><TD
  619. COLSTART="1"><P><B><FONT FACE="verdana, arial, helvetica"><FONT
  620. COLOR="#FF0000">Account
  621. Manager</FONT> Status:  Username Taken!</FONT></B></P>
  622. <P><FONT SIZE="-1" COLOR="$fontcolor" FACE="verdana, arial, helvetica">The Username: $INPUT{'username'} has already been reserved by someone awaiting membership</FONT></P>
  623. <P><FONT SIZE="-1" COLOR="$fontcolor" FACE="verdana, arial, helvetica">Please choose another Username.</FONT></P>
  624. <HR SIZE="1">
  625. <CENTER><FONT SIZE="-2" FACE="verdana, arial, helvetica"><B>$orgname maintained with
  626. <A HREF="http://cgi.elitehost.com/"><B>Account Manager $version</B></A></B></FONT> 
  627. </CENTER></TD></TR></ROWS></TBODY></TABLE></CENTER>
  628. EOF
  629. &footer;
  630.   exit;   
  631.  
  632. }
  633. }
  634. }
  635.  
  636. sub dupeaddress {
  637. #print "Content-type: text/html\n\n";
  638. open (EMAIL, "<$memberinfo/amdata.db");
  639. if ($LOCK_EX){ 
  640.       flock(EMAIL, $LOCK_EX); #Locks the file
  641.     }
  642. @database_array = <EMAIL>;
  643.  close (EMAIL);
  644.  
  645. foreach $lines(@database_array) {
  646.           @edit_array = split(/\:/,$lines);
  647. &parseemail;
  648.  
  649. if ($edit_array[2] eq $email) {
  650.  
  651. # if ($edit_array[2] =~ /$INPUT{'email'}/i) {
  652. print "Content-type: text/html\n\n";
  653. &header;
  654. print<<EOF;
  655. <CENTER><BR>
  656. <TABLE BORDER="0" WIDTH="450"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR><TD
  657. COLSTART="1"><P><B><FONT FACE="verdana, arial, helvetica"><FONT
  658. COLOR="#FF0000">Account
  659. Manager</FONT> Status:  Address Taken!</FONT></B></P>
  660. <P><FONT SIZE="-1" COLOR="$fontcolor" FACE="verdana, arial, helvetica">The E-mail address: $INPUT{'email'} is already in our database. </FONT></P>
  661. <P><FONT SIZE="-1" COLOR="$fontcolor" FACE="verdana, arial, helvetica">Please contact
  662. <A HREF="mailto:$orgmail"><B>$orgname Support</B></A> if you
  663. need any further assistance.</FONT></P>
  664. <HR SIZE="1">
  665. <CENTER><FONT SIZE="-2" FACE="verdana, arial, helvetica"><B>$orgname maintained with
  666. <A HREF="http://cgi.elitehost.com/"><B>Account Manager $version</B></A></B></FONT> 
  667. </CENTER></TD></TR></ROWS></TBODY></TABLE></CENTER>
  668. EOF
  669. &footer;
  670. exit;
  671. }
  672. }
  673. }
  674.  
  675. sub dupeaddress2 {
  676.  
  677.  
  678. opendir (DIR, "$memberinfo");
  679. close (DIR); 
  680. @file = grep { /.infotmp/} readdir(DIR);
  681.  foreach $lines(@file) {
  682.  
  683.        open (DAT, "<$memberinfo/$lines");
  684. if ($LOCK_EX){ 
  685.       flock(DAT, $LOCK_EX); #Locks the file
  686.     } 
  687.              @approval = <DAT>;
  688.                 foreach $item(@approval) {
  689.                     @edit_approval = split(/\:/,$item);
  690.  
  691.  &parseemail;                 
  692.  
  693. if ($edit_approval[2] eq $email) {last; }
  694.  
  695. # if ($edit_approval[2] =~ /$INPUT{'email'}/i) {last; }
  696. }
  697.  
  698. if ($edit_approval[2] eq $email) {
  699.  
  700. # if ($edit_approval[2] =~ /$INPUT{'email'}/i) {
  701. print "Content-type: text/html\n\n";
  702. &header;
  703. print<<EOF;
  704. <CENTER><BR>
  705. <TABLE BORDER="0" WIDTH="450"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR><TD
  706. COLSTART="1"><P><B><FONT FACE="verdana, arial, helvetica"><FONT
  707. COLOR="#FF0000">Account
  708. Manager</FONT> Status:  Address Taken!</FONT></B></P>
  709. <P><FONT COLOR="$fontcolor" SIZE="-1" FACE="verdana, arial, helvetica">The E-mail address:
  710. $INPUT{'email'} was found in use by someone awaiting membership.</FONT></P>
  711. <P><FONT COLOR="$fontcolor" SIZE="-1" FACE="verdana, arial, helvetica">Please contact
  712. <A HREF="mailto:$orgmail"><B>$orgname Support</B></A> if you need any further
  713. assistance.</FONT></P>
  714. <HR SIZE="1">
  715. <CENTER><FONT SIZE="-2" FACE="verdana, arial, helvetica"><B>$orgname
  716. maintained with
  717. <A HREF="http://cgi.elitehost.com/"><B>Account Manager $version</B></A></B></FONT> 
  718. </CENTER></TD></TR></ROWS></TBODY></TABLE></CENTER>
  719. EOF
  720. &footer;
  721. #close (DIR);
  722. exit;
  723.  
  724. }
  725. }
  726. }
  727.  
  728. sub dupepwd {
  729.  
  730.  
  731. opendir (DIR, "$memberinfo");
  732. close (DIR); 
  733. @file = grep { /.infotmp/} readdir(DIR);
  734.  foreach $lines(@file) {
  735.  
  736.        open (DAT, "<$memberinfo/$lines");
  737. if ($LOCK_EX){ 
  738.       flock(DAT, $LOCK_EX); #Locks the file
  739.     } 
  740.              @approval = <DAT>;
  741.                 foreach $item(@approval) {
  742.                     @edit_approval = split(/\:/,$item);
  743.  
  744.  if ($edit_approval[1] =~ /$INPUT{'pwd'}\b/i) {last; }
  745. }
  746.  
  747. if ($edit_approval[1] =~ /$INPUT{'pwd'}\b/i) {
  748. print "Content-type: text/html\n\n";
  749. &header;
  750. print<<EOF;
  751. <CENTER><BR>
  752. <TABLE BORDER="0" WIDTH="450"><TBODY><COLDEFS><COLDEF></COLDEFS><ROWS><TR><TD
  753. COLSTART="1"><P><B><FONT FACE="verdana, arial, helvetica"><FONT
  754. COLOR="#FF0000">Account
  755. Manager</FONT> Status:  Address Taken!</FONT></B></P>
  756. <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>
  757. <P><FONT SIZE="-1" COLOR="$fontcolor" FACE="verdana, arial, helvetica">Please contact
  758. <A HREF="mailto:$orgmail"><B>$orgname Support</B></A> if you need any further
  759. assistance.</FONT></P>
  760. <HR SIZE="1">
  761. <CENTER><FONT SIZE="-2" FACE="verdana, arial, helvetica"><B>$orgname
  762. maintained with
  763. <A HREF="http://cgi.elitehost.com/"><B>Account Manager $version</B></A></B></FONT> 
  764. </CENTER></TD></TR></ROWS></TBODY></TABLE></CENTER>
  765. EOF
  766. &footer;
  767. #close (DIR);
  768. exit;
  769.  
  770. }
  771. }
  772. }
  773.  
  774.  
  775. ######################################
  776. # Create temp files for Admin approval
  777. ######################################
  778.  
  779. sub temp {
  780.  
  781.  
  782.  
  783. $INPUT{'fname'} =~ s/\s+$//;
  784. $INPUT{'lname'} =~ s/\s+$//;
  785.  
  786.  
  787. $newline2 = join
  788. ("\:",$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);
  789. $newline2 .= "\n";
  790.  
  791. open(TEMP2, ">$memberinfo/$INPUT{'username'}.infotmp") or print "unable to create user info temp file.  Check your directory permission settings";
  792. if ($LOCK_EX){ 
  793.       flock(TEMP2, $LOCK_EX); #Locks the file
  794.     }
  795. print TEMP2 $newline2;
  796. close (TEMP2);
  797.  
  798. #unlink ("$memberinfo/$INPUT{'username'}.infotmp");
  799.  
  800.  
  801. #}
  802.  
  803. if ($INPUT{$lines}) {
  804. unlink ("$memberinfo/$lines");
  805.  
  806.  
  807.  
  808. }
  809.  
  810. #}
  811. &close;
  812.  
  813. exit;
  814.  
  815. }
  816.  
  817.  
  818.  
  819. sub parseusername {
  820. $desiredname = $INPUT{'username'};
  821. $lines =~ tr/A-Z/a-z/;
  822. $desiredname =~ tr/A-Z/a-z/;
  823. }
  824.  
  825. sub parseusername2 {
  826. $desiredname = $INPUT{'username'};
  827. $edit_array[0] =~ tr/A-Z/a-z/;
  828. $desiredname =~ tr/A-Z/a-z/;
  829. }
  830.  
  831.  
  832. sub parseemail {
  833. $email = $INPUT{'email'};
  834. $edit_array[2] =~ tr/A-Z/a-z/;
  835. $email =~ tr/A-Z/a-z/;
  836. }
  837.  
  838.  
  839.  
  840.  
  841. sub header {
  842. open (FILE,"<$header/header.txt"); #### Full path name from root. 
  843.  @headerfile = <FILE>;
  844.  close(FILE);
  845. print "<HTML><HEAD><TITLE></TITLE></HEAD><BODY $bodyspec>\n";
  846. foreach $line(@headerfile) {
  847. print "$line";
  848.   }
  849. }
  850.  
  851.  
  852. sub footer {
  853. open (FILE,"<$footer/footer.txt"); #### Full path name from root. 
  854.  @footerfile = <FILE>;
  855.  close(FILE);
  856. foreach $line(@footerfile) {
  857. print "$line";
  858. }
  859. print "</BODY></HTML>";
  860. }
  861.  
  862.  

d) config.pl
========
Expand|Select|Wrap|Line Numbers
  1. #!c:\perl\bin\perl.exe
  2. #!/usr/bin/perl
  3.  
  4. # You will find a complete HTML tutorial/manual at:
  5. # http://siteinteractive.com/acctlite/tutorial/
  6. #
  7. # Version 1.09
  8. ##############################################################
  9. # EDIT USER CONFIGURATIONS BELOW
  10. # Note: These are the only configurations you will need to
  11. # set in Account Manager LITE.
  12. #
  13. # Be sure to set the "require" paths in both the acctman.pl
  14. # and the amadmin.pl files.
  15. ##############################################################
  16.  
  17. # Add your BODY tag information, like background graphic, color, etc.
  18. $bodyspec = "background=\"\" bgcolor=\"#FFFFFF\" link=\"#0000FF\" vlink=\"#0000FF\"";
  19.  
  20. # Add your own graphics, text, links, etc., to the top of your pages.
  21. # Give the full directory path to your header.txt file.  DO NOT include
  22. # the header.txt file in the path here, just the directories.
  23. # $header = "C:/full/path/to/directory";
  24. $header = "";
  25.  
  26. # Add your own graphics, text, links, etc., to the bottom of your pages.
  27. # Give the full directory path to your footer.txt file.  DO NOT include
  28. # the footer.txt file in the path here, just the directories.
  29. # $footer = "C:/full/path/to/directory";
  30. $footer = "";
  31.  
  32. # Edit the font colors of the text on the help and error screens that
  33. # users will see.  This is helpful if you add a background color or
  34. # graphic.
  35. $fontcolor = "#000000";
  36.  
  37. # Type the name of your organization, group, or company
  38. $orgname = "Account Manager Demo";
  39.  
  40. # Type an email address that customer/user can respond to
  41. # Remember to put a backslash \ before your @
  42. # eg: $orgmail = "whatever\@wherever.com";
  43. $orgmail = "whatever\@wherever.com";
  44.  
  45. # Type the full path to your Mail program
  46. $mailprog = "c:/winnt/system32/blat.exe";
  47.  
  48.  
  49.  
  50. # This would be the subject of the e-mail your users will
  51. # receive automatically once they have submitted their
  52. # application.
  53. $response_subject = "Application Received";
  54.  
  55. # If you use .htaccess or .nsconfig, use a "1", otherwise leave blank
  56. # or set to "0".  This is if you use a secure users area.
  57. $htaccess = "1";
  58.  
  59. # If you entered "1" above, enter the full path to your
  60. # htpasswd or .nsconfig file.
  61. # Like this: $memaccess = "c:/full/path/to/.htpasswd";
  62. # This is the file that houses the usernames and encrypted passwords
  63. # but is only needed if you use .htaccess or .nsconfig
  64. $memaccess = "c:/full/directory/path/to/info/.htpasswd";
  65.  
  66. # Type the full path to the database file that contains all the info
  67. $memberinfo = "c:/full/directory/path/to/info";
  68.  
  69.  
  70. # Upload the approved.txt, denied.txt, and email.txt files
  71. # that come with Account Manager to your $memberinfo directory.
  72. # These files are used to send automatic e-mail responses to
  73. # your customers/subscribers.  Edit these files as needed.
  74.  
  75.  
  76. # Type a full path for a temp directory that BLAT Mail can use
  77. # as well as store other temporary files
  78. $tempdir = "c:/full/directory/path/to/temp";
  79.  
  80.  
  81. # Give the full directory path where you would like your password.txt
  82. # file to be saved.  DO NOT include the name password.txt in the path
  83. # here, just the directories.  $passfile = "/full/path/to/directory";
  84. $passfile = "c:/full/directory/path/to/info";
  85.  
  86.  
  87. # If you are run the script and receive File Locking (flock)
  88. # errors, remove the number 2 from between the quotes.
  89. # Then it would appear: $LOCK_EX = "";
  90. $LOCK_EX = "2";
  91.  
  92.  
  93. # Type the subject that will appear in the email customer/user
  94. # receives
  95. $subject = "ABC Member Info";
  96.  
  97.  
  98. # Encryption
  99. # If you are using Apache for Windows, you will want to leave this
  100. # to the default setting of $crypt = "";
  101. # If you are using a crypt-capable web server, place a 1 between the
  102. # quotes, to encrypt your passwords.  
  103.  
  104. $crypt = "";
  105.  
  106.  
  107. # Create two text files.  One called "approved.txt" and the other
  108. # called "denied.txt".  In each, write the response that you would
  109. # like your prospective members to receive when you have either
  110. # approved or denied their application for membership, respectively.
  111. # Then, upload both text files to your $memberinfo directory.
  112. # The script will do the rest.
  113. # Example, in the "approved.txt" file, you can type:
  114. # "Your account is now active."
  115.  
  116.  
  117. # Subject of email that is automatically sent to users that you
  118. # chose not to accept in your Account Manager.
  119. $denied_email_subject = "Application Denied";
  120.  
  121. # Subject for email that is automatically sent to users that you
  122. # chose to accept in your Account Manager.
  123. $approved_email_subject = "Application Approved";
  124.  
  125. # This is the e-mail Subject for the response that is sent back to
  126. # you, the administrator, when a signup request is received.
  127. $signupresponse = "Account Manager Lite Signup Response";
  128.  
  129.  
  130.  
Oct 16 '08 #1
Share this Question
Share on Google+
10 Replies


numberwhun
Expert Mod 2.5K+
P: 3,503
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
Oct 17 '08 #2

100+
P: 236
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
Oct 17 '08 #3

numberwhun
Expert Mod 2.5K+
P: 3,503
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
Oct 17 '08 #4

KevinADC
Expert 2.5K+
P: 4,059
He has Apache installed on the D drive but the "require" call (line 75 acctman.pl) is to the C drive.
Oct 17 '08 #5

100+
P: 236
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
Oct 17 '08 #6

100+
P: 236
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
Oct 17 '08 #7

KevinADC
Expert 2.5K+
P: 4,059
line 245 acctman.pl

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

http://www.blat.net/194/

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.
Oct 17 '08 #8

100+
P: 236
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
Oct 18 '08 #9

100+
P: 236
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
Oct 18 '08 #10

KevinADC
Expert 2.5K+
P: 4,059
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.
Oct 18 '08 #11

Post your reply

Sign in to post your reply or Sign up for a free account.