home *** CD-ROM | disk | FTP | other *** search
/ PC World 1999 May / PCWorld_1999-05_cd.bin / Komunik / MSIE5 / ieak5.exe / RCDATA / CABINET / signup04.pl < prev    next >
Perl Script  |  1999-02-24  |  7KB  |  153 lines

  1. #!/usr/bin/perl
  2. # Written by Edward C Kubaitis
  3.  
  4.  
  5. # The host URL of the Signup Files
  6. $hostURL="http://myserver/";
  7.  
  8. # Parse the CGI input
  9. $BACKURL=&parse_input;
  10.  
  11.     if ($FORM{'PAYMENT_TYPE'} eq "Visa"){
  12.         $FORM{'PAYMENT_BILLADDRESS'} = $FORM{'V_PAYMENT_BILLADDRESS'};
  13.         $FORM{'PAYMENT_BILLZIP'} = $FORM{'V_PAYMENT_BILLZIP'};
  14.         $FORM{'PAYMENT_CARDNUMBER'} = $FORM{'V_PAYMENT_CARDNUMBER'};
  15.         $FORM{'PAYMENT_EXMONTH'} = $FORM{'V_PAYMENT_EXMONTH'};
  16.         $FORM{'PAYMENT_EXYEAR'} = $FORM{'V_PAYMENT_EXYEAR'};
  17.         $FORM{'PAYMENT_CARDHOLDER'} = $FORM{'V_PAYMENT_CARDHOLDER'};
  18.     }
  19.     if ($FORM{'PAYMENT_TYPE'} eq "Master Card"){
  20.         $FORM{'PAYMENT_BILLADDRESS'} = $FORM{'MC_PAYMENT_BILLADDRESS'};
  21.         $FORM{'PAYMENT_BILLZIP'} = $FORM{'MC_PAYMENT_BILLZIP'};
  22.         $FORM{'PAYMENT_CARDNUMBER'} = $FORM{'MC_PAYMENT_CARDNUMBER'};
  23.         $FORM{'PAYMENT_EXMONTH'} = $FORM{'MC_PAYMENT_EXMONTH'};
  24.         $FORM{'PAYMENT_EXYEAR'} = $FORM{'MC_PAYMENT_EXYEAR'};
  25.         $FORM{'PAYMENT_CARDHOLDER'} = $FORM{'MC_PAYMENT_CARDHOLDER'};
  26.     }
  27.     if ($FORM{'PAYMENT_TYPE'} eq "American Express"){
  28.         $FORM{'PAYMENT_BILLADDRESS'} = $FORM{'AE_PAYMENT_BILLADDRESS'};
  29.         $FORM{'PAYMENT_BILLZIP'} = $FORM{'AE_PAYMENT_BILLZIP'};
  30.         $FORM{'PAYMENT_CARDNUMBER'} = $FORM{'AE_PAYMENT_CARDNUMBER'};
  31.         $FORM{'PAYMENT_EXMONTH'} = $FORM{'AE_PAYMENT_EXMONTH'};
  32.         $FORM{'PAYMENT_EXYEAR'} = $FORM{'AE_PAYMENT_EXYEAR'};
  33.         $FORM{'PAYMENT_CARDHOLDER'} = $FORM{'AE_PAYMENT_CARDHOLDER'};
  34.     }
  35.     if ($FORM{'PAYMENT_TYPE'} eq "Bill Through Mail"){
  36.         $FORM{'PAYMENT_BILLADDRESS'} = $FORM{'BM_PAYMENT_BILLADDRESS'};
  37.         $FORM{'PAYMENT_BILLEXADDRESS'} = $FORM{'BM_PAYMENT_BILLEXADDRESS'};
  38.         $FORM{'PAYMENT_BILLCITY'} = $FORM{'BM_PAYMENT_BILLCITY'};
  39.         $FORM{'PAYMENT_BILLSTATE'} = $FORM{'BM_PAYMENT_BILLSTATE'};
  40.         $FORM{'PAYMENT_BILLZIP'} = $FORM{'BM_PAYMENT_BILLZIP'};
  41.  
  42.     }
  43.     if ($FORM{'PAYMENT_TYPE'} eq "Phone Bill"){
  44.         $FORM{'PAYMENT_BILLNAME'} = $FORM{'PB_PAYMENT_BILLNAME'};
  45.         $FORM{'PAYMENT_BILLPHONE'} = $FORM{'PB_PAYMENT_BILLPHONE'};
  46.     }
  47.  
  48.  
  49. # Start HTML output
  50. &startHTML;
  51.  
  52. # Display the HTML head
  53. &headHTML;
  54.  
  55. # Display the HTML body
  56. &bodyHTML;
  57.  
  58. # End HTML output
  59. &endHTML;
  60.  
  61. # Exit the CGI
  62. &quit;
  63.  
  64. ##########################################################
  65. sub startHTML {
  66.     print "Content-type: text/html\n\n";print "<HTML>\n";
  67. }
  68. ##########################################################
  69. sub endHTML {
  70.     print "</html>\n";
  71. }
  72. ##########################################################
  73. sub quit {
  74.     exit(0);
  75. }
  76. ##########################################################
  77. sub parse_input {
  78.     @pairs = split(/&/, $ENV{'QUERY_STRING'});
  79.  
  80.     foreach $pair (@pairs) {
  81.        ($name, $value) = split(/=/, $pair);
  82.     $ABACKURL=$ABACKURL+"$name=$value\&";
  83.        # Un-Webify plus signs and %-encoding
  84.        $value =~ tr/+/ /;
  85.           $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
  86.           $value =~ s/<!--(.|\n)*-->//g;
  87.           if ($allow_html != 1) {
  88.           $value =~ s/<([^>]|\n)*>//g;
  89.           }
  90.          if ($value eq ""){$value=" ";}
  91.        $FORM{$name} = $value;
  92.     
  93.     }
  94. chop($ABACKURL);return ABACKURL;
  95. }##########################################################
  96. sub bodyHTML {
  97.  
  98. print "<BODY  bgColor=THREEDFACE color=WINDOWTEXT>\n";
  99. print "<FONT style=\"font: 8pt ' ms sans serif' black\">\n";
  100.  
  101. print "<FORM NAME=PAGEID ACTION=PAGE4 STYLE=background:transparent></FORM>\n";
  102. print "<FORM NAME=BACK ACTION=\"$hostURL/signup03.pl?$BACKURL\" STYLE=background:transparent></FORM>\n";
  103. print "<FORM NAME=PAGETYPE ACTION=\"\" STYLE=background:transparent></FORM>\n";
  104. print "<FORM NAME=NEXT ACTION=$hostURL/signup06.pl STYLE=background:transparent>\n";
  105. print "<B>Welcome To IEAK Sample Signup Server</B><BR>\n";
  106. print "This is where we will collect the information to create your internet account.<P>\n";
  107. print "<TABLE style=\"font: 8pt ' ms sans serif' black\" cellpadding=5>\n";
  108. print "<TR><TD COLSPAN=2>Please enter the e-mail name you wish to use.</TD></TR>\n";
  109. print "<TR><TD>E-Mail Name </TD><TD><INPUT NAME=\"EMAILNAME\" TYPE=\"TEXT\" SIZE=\"25\" VALUE=\"$FORM{'EMAILNAME'}\"></TD></TR>\n";
  110. print "<TR><TD COLSPAN=2>Please enter the e-mail password you wish to use.</TD></TR>\n";
  111. print "<TR><TD>E-Mail Password </TD><TD>\n";
  112. print "<INPUT NAME=\"EMAILPASSWORD\" TYPE=\"TEXT\" SIZE=\"25\" VALUE=\"$FORM{'EMAILPASSWORD'}\"></TD></TR></TABLE>\n";
  113. print "<INPUT TYPE=\"HIDDEN\" NAME=\"USER_FIRSTNAME\" VALUE=\"$FORM{'USER_FIRSTNAME'}\">\n";
  114. print "<INPUT TYPE=\"HIDDEN\" NAME=\"USER_LASTNAME\" VALUE=\"$FORM{'USER_LASTNAME'}\">\n";
  115. print "<INPUT TYPE=\"HIDDEN\" NAME=\"USER_ADDRESS\" VALUE=\"$FORM{'USER_ADDRESS'}\">\n";
  116. print "<INPUT TYPE=\"HIDDEN\" NAME=\"USER_MOREADDRESS\" VALUE=\"$FORM{'USER_MOREADDRESS'}\">\n";
  117. print "<INPUT TYPE=\"HIDDEN\" NAME=\"USER_CITY\" VALUE=\"$FORM{'USER_CITY'}\">\n";
  118. print "<INPUT TYPE=\"HIDDEN\" NAME=\"USER_STATE\" VALUE=\"$FORM{'USER_STATE'}\">\n";
  119. print "<INPUT TYPE=\"HIDDEN\" NAME=\"USER_ZIP\" VALUE=\"$FORM{'USER_ZIP'}\">\n";
  120. print "<INPUT TYPE=\"HIDDEN\" NAME=\"USER_PHONE\" VALUE=\"$FORM{'USER_PHONE'}\">\n";
  121. print "<INPUT TYPE=\"HIDDEN\" NAME=\"AREACODE\" VALUE=\"$FORM{'AREACODE'}\">\n";
  122. print "<INPUT TYPE=\"HIDDEN\" NAME=\"COUNTRYCODE\" VALUE=\"$FORM{'COUNTRYCODE'}\">\n";
  123. print "<INPUT TYPE=\"HIDDEN\" NAME=\"USER_FE_NAME\" VALUE=\"$FORM{'USER_FE_NAME'}\">\n";
  124. print "<INPUT TYPE=\"HIDDEN\" NAME=\"PAYMENT_TYPE\" VALUE=\"$FORM{'PAYMENT_TYPE'}\">\n";
  125. print "<INPUT TYPE=\"HIDDEN\" NAME=\"PAYMENT_BILLNAME\" VALUE=\"$FORM{'PAYMENT_BILLNAME'}\">\n";
  126. print "<INPUT TYPE=\"HIDDEN\" NAME=\"PAYMENT_BILLADDRESS\" VALUE=\"$FORM{'PAYMENT_BILLADDRESS'}\">\n";
  127. print "<INPUT TYPE=\"HIDDEN\" NAME=\"PAYMENT_BILLEXADDRESS\" VALUE=\"$FORM{'PAYMENT_BILLEXADDRESS'}\">\n";
  128. print "<INPUT TYPE=\"HIDDEN\" NAME=\"PAYMENT_BILLCITY\" VALUE=\"$FORM{'PAYMENT_BILLCITY'}\">\n";
  129. print "<INPUT TYPE=\"HIDDEN\" NAME=\"PAYMENT_BILLSTATE\" VALUE=\"$FORM{'PAYMENT_BILLSTATE'}\">\n";
  130. print "<INPUT TYPE=\"HIDDEN\" NAME=\"PAYMENT_BILLZIP\" VALUE=\"$FORM{'PAYMENT_BILLZIP'}\">\n";
  131. print "<INPUT TYPE=\"HIDDEN\" NAME=\"PAYMENT_BILLPHONE\" VALUE=\"$FORM{'PAYMENT_BILLPHONE'}\">\n";
  132. print "<INPUT TYPE=\"HIDDEN\" NAME=\"PAYMENT_DISPLAYNAME\" VALUE=\"$FORM{'PAYMENT_DISPLAYNAME'}\">\n";
  133. print "<INPUT TYPE=\"HIDDEN\" NAME=\"PAYMENT_CARDNUMBER\" VALUE=\"$FORM{'PAYMENT_CARDNUMBER'}\">\n";
  134. print "<INPUT TYPE=\"HIDDEN\" NAME=\"PAYMENT_EXMONTH\" VALUE=\"$FORM{'PAYMENT_EXMONTH'}\">\n";
  135. print "<INPUT TYPE=\"HIDDEN\" NAME=\"PAYMENT_EXYEAR\" VALUE=\"$FORM{'PAYMENT_EXYEAR'}\">\n";
  136. print "<INPUT TYPE=\"HIDDEN\" NAME=\"PAYMENT_CARDHOLDER\" VALUE=\"$FORM{'PAYMENT_CARDHOLDER'}\">\n";
  137. print "<INPUT TYPE=\"HIDDEN\" NAME=\"SIGNED_PID\" VALUE=\"$FORM{'SIGNED_PID'}\">\n";
  138. print "</FORM>\n";
  139. print "</BODY>\n";
  140.  
  141. }
  142. ##########################################################
  143. sub headHTML {
  144.  
  145.  
  146. print "<HEAD>\n";
  147. print "<TITLE>IEAK Sample</TITLE>\n";
  148. print "</HEAD>\n";
  149.  
  150.  
  151. }
  152. ##########################################################
  153.