home *** CD-ROM | disk | FTP | other *** search
/ Excalibur 71 / Excalibur_71_cd2.bin / Microsoft_Internet_50 / ieak5.exe / RCDATA / CABINET / signup02.pl < prev    next >
Perl Script  |  1999-02-24  |  4KB  |  101 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. # Start HTML output
  12. &startHTML;
  13.  
  14. # Display the HTML head
  15. &headHTML;
  16.  
  17. # Display the HTML body
  18. &bodyHTML;
  19.  
  20. # End HTML output
  21. &endHTML;
  22.  
  23. # Exit the CGI
  24. &quit;
  25.  
  26. ##########################################################
  27. sub startHTML {
  28.     print "Content-type: text/html\n\n";print "<HTML>\n";
  29. }
  30. ##########################################################
  31. sub endHTML {
  32.     print "</html>\n";
  33. }
  34. ##########################################################
  35. sub quit {
  36.     exit(0);
  37. }
  38. ##########################################################
  39. sub parse_input {
  40.     @pairs = split(/&/, $ENV{'QUERY_STRING'});
  41.  
  42.     foreach $pair (@pairs) {
  43.        ($name, $value) = split(/=/, $pair);
  44.     $ABACKURL=$ABACKURL+"$name=$value\&";
  45.        # Un-Webify plus signs and %-encoding
  46.        $value =~ tr/+/ /;
  47.           $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
  48.           $value =~ s/<!--(.|\n)*-->//g;
  49.           if ($allow_html != 1) {
  50.           $value =~ s/<([^>]|\n)*>//g;
  51.           }
  52.          if ($value eq ""){$value=" ";}
  53.        $FORM{$name} = $value;
  54.     
  55.     }
  56. chop($ABACKURL);return $ABACKURL;
  57. }
  58. ##########################################################
  59. sub bodyHTML {
  60.  
  61. print "<BODY  bgColor=THREEDFACE color=WINDOWTEXT>\n";
  62. print "<FONT style=\"font: 8pt ' ms sans serif' black\">\n";
  63.  
  64. print "<FORM NAME=PAGEID ACTION=PAGE2 STYLE=background:transparent></FORM>\n";
  65. print "<FORM NAME=BACK ACTION=\"$hostURL/signup01.pl?$BACKURL\" STYLE=background:transparent></FORM>\n";
  66. print "<FORM NAME=PAGETYPE ACTION=\"\" STYLE=background:transparent></FORM>\n";
  67. print "<FORM NAME=NEXT ACTION=$hostURL/signup03.pl STYLE=background:transparent>\n";
  68. print "<B>Welcome To IEAK Sample Signup Server</B><BR>\n";
  69. print "This is where we will collect the information to create your internet account.<P>\n";
  70. print "<TABLE style=\"font: 8pt ' ms sans serif' black\" cellpadding=5>\n";
  71.   print "<INPUT ID = BILLING1 NAME=BILLING TYPE=radio VALUE=option1 ACCESSKEY = \"1\" CHECKED>\n";
  72.   print "<LABEL FOR = \"BILLING1\">\n";
  73.   print "<U>1</U>: Unlimited use for \$19.95 a month  </LABEL>  <P>\n";
  74.   print "<INPUT ID = \"BILLING2\" NAME = \"BILLING\" TYPE = \"radio\" VALUE = \"option2\" ACCESSKEY = \"2\">\n";
  75.   print "<LABEL FOR = \"BILLING2\">  <U>2</U>: \$2.00 per hour during peak hours\n";
  76.   print "</LABEL>\n";
  77. print "<INPUT TYPE=\"HIDDEN\" NAME=\"USER_FIRSTNAME\" VALUE=\"$FORM{'USER_FIRSTNAME'}\">\n";
  78. print "<INPUT TYPE=\"HIDDEN\" NAME=\"USER_LASTNAME\" VALUE=\"$FORM{'USER_LASTNAME'}\">\n";
  79. print "<INPUT TYPE=\"HIDDEN\" NAME=\"USER_ADDRESS\" VALUE=\"$FORM{'USER_ADDRESS'}\">\n";
  80. print "<INPUT TYPE=\"HIDDEN\" NAME=\"USER_MOREADDRESS\" VALUE=\"$FORM{'USER_MOREADDRESS'}\">\n";
  81. print "<INPUT TYPE=\"HIDDEN\" NAME=\"USER_CITY\" VALUE=\"$FORM{'USER_CITY'}\">\n";
  82. print "<INPUT TYPE=\"HIDDEN\" NAME=\"USER_STATE\" VALUE=\"$FORM{'USER_STATE'}\">\n";
  83. print "<INPUT TYPE=\"HIDDEN\" NAME=\"USER_ZIP\" VALUE=\"$FORM{'USER_ZIP'}\">\n";
  84. print "<INPUT TYPE=\"HIDDEN\" NAME=\"USER_PHONE\" VALUE=\"$FORM{'USER_PHONE'}\">\n";
  85. print "<INPUT TYPE=\"HIDDEN\" NAME=\"BILLING\" VALUE=\"$FORM{'BILLING'}\">\n";
  86. print "</FORM></table>\n";
  87. print "</BODY>\n";
  88.  
  89. }
  90. ##########################################################
  91. sub headHTML {
  92.  
  93.  
  94. print "<HEAD>\n";
  95. print "<TITLE>IEAK Sample</TITLE>\n";
  96. print "</HEAD>\n";
  97.  
  98.  
  99. }
  100. ##########################################################
  101.