home *** CD-ROM | disk | FTP | other *** search
- #!/usr/local/bin/perl
- push (@INC, "/usr/local/business/http/accn.com/cgi-bin");
- require("cgi-lib.pl");
- print &PrintHeader;
- &ReadParse(*regdata);
-
- print<<"EOP" ;
- <HTML>
- <HEAD><TITLE> Leading Rein confirmation </TITLE>
- </HEAD>
- <BODY>
- EOP
-
- &save_registration_data(regdata);
- &mail_confirmation(regdata);
-
- if (length($regdata{"First Name"}) >0 && length($regdata{"Last Name"}) >0 )
- {
- print <<"EOP" ;
- <h3>
- Thank you $regdata{"First Name"} $regdata{"Last Name"} for registering with
- the Leading Rein.</h3> Please verify the following information and make
- any corrections necessary.
- EOP
- $registration_type="Confirm Registration Data";
- print "<ul>";
- foreach $var (keys (%regdata) )
- {
- if (length($regdata{"$var"})== 0)
- {
- print "<li>Your <em> $var </em> will be used to help confirm your order please fill in the <em> $var </em> field" ;
- }
- }
- print "</ul>";
-
- }
- else
- {
- $registration_type="Submit Registration";
- }
- if (defined ($regdata{"Phone Number"} ))
- {
- $PhoneNumber = $regdata{"Phone Number"} ;
- }
- else
- {
- $PhoneNumber ="(999) 999-9999";
- }
-
-
- print <<"TEST" ;
- <hr noshade>
- <center>
- <FORM Method=POST Action="/cgibook/chap7/reg4.cgi">
- <!-- FORM Method=GET Action="/cgi-bin/env.cgi" -->
- <input type=hidden name=SavedName value="$regdata{'First Name'} $regdata{'Last Name'}">
- <table border = 0 width=60%>
- <caption align = top> <H3>Leading Rein Registration Form </H3></caption>
- <th ALIGN=LEFT> First Name
- <th ALIGN=LEFT colspan=2 > Last Name <tr>
-
- <td>
- <input type=text size=10 maxlength=20
- name="First Name" value=$regdata{"First Name"} >
- <td colspan=2>
- <input type=text size=32 maxlength=40
- name="Last Name" value=$regdata{"Last Name"} > <tr>
- <th ALIGN=LEFT colspan=3>
- Street Address <td> <td> <tr>
-
-
- <td colspan=3>
- <input type=text size=61 maxlength=61
- name="Street" value="$regdata{'Street'}" > <tr>
- <th ALIGN=LEFT > City
- <th ALIGN=LEFT > State
- <th ALIGN=LEFT > Zip <tr>
- <td> <input type=text size=20 maxlength=30
- name="City" value="$regdata{'City'}" >
- <td> <input type=text size=20 maxlength=20
- name="State" value="$regdata{'State'}" >
- <td> <input type=text size=5 maxlength=10
- name="zip" value="$regdata{'zip'}" > <tr>
-
- <th ALIGN=LEFT colspan=1> Phone Number
- <th ALIGN=LEFT colspan=2> Email Address <tr>
- <td colspan=1> <input type=text size=15 maxlength=15
- name="Phone Number" value="$PhoneNumber ">
- <td colspan=2> <input type=text size=32 maxlength=32
- name="Email Address" value=$regdata{"Email Address"} ><tr>
- <td width=50%> <input type="submit" name="simple" value=" $registration_type " >
- <td width=50%> <input type=reset> <tr>
-
- </table>
- </FORM>
- </center>
- <hr noshade>
- </body>
- </html>
- TEST
-
- sub save_registration_data {
- local($regdata) = @_;
- if ($regdata{'simple'} eq " Confirm Registration Data ")
- {
- open (RegDataFile,
- '>>/usr/local/business/http/accn.com/cgibook/chap7/rdf')
- || die "cant open reg data file\n";
-
- foreach $var (keys (%regdata) )
- {
- print (RegDataFile "$var = $regdata{\"$var\"}:");
- # print "$var $regdata{$var}:";
- }
- # print (RegDataFile "\n");
- print "<br>";
-
- }
- }
-
- 01: sub mail_confirmation{
- 02: local($regdata) = @_;
- 03: $temp = "Thank you $regdata{'First Name'} $regdata{'Last Name'} for registering with the Leading Rein.\n";
- 04: if ($regdata{'simple'} eq " Confirm Registration Data ")
- 05: {
- 06: if ($regdata{'Email Address'} =~ /[;><&\*`\|]/ ){
- 07: print "<hr><h3> The email address you submitted is malformed.</h3> $regdata{'Email Address'}<hr> ";
- 08: }
- 09: else {
-
- 10: open (MAIL, "|mail $regdata{'Email Address'}")
- 11: || die "cant mail program\n";
- 12: print MAIL <<EOM;
- 13: $temp
- 14: Please verify the following information.
-
- 15: Your name is and mailing address are:
- 16: $regdata{'First Name'} $regdata{'Last Name'}
- 17: $regdata{'Street'}
- 18: $regdata{'City'}, $regdata{'State'} $regdata{'zip'}
-
- 19: Your phone number is $regdata{'Phone Number'}
- 20: EOM
- 21: }
- 22: }
- 23: }
-
-
-
-
-