home *** CD-ROM | disk | FTP | other *** search
/ Teach Yourself CGI Programming with Perl in a Week / CGIPROGRAMMINGPERL.iso / booksrc / 07cgil01.cgi < prev    next >
Encoding:
Text File  |  1995-12-08  |  2.5 KB  |  95 lines

  1. #!/usr/local/bin/perl
  2. push (@INC, "/usr/local/business/http/accn.com/cgi-bin");
  3. require("cgi-lib.pl");
  4. print &PrintHeader;
  5. &ReadParse(*regdata);
  6.  
  7. print<<"EOP" ;
  8. <HTML>
  9. <HEAD><TITLE> Leading Rein confirmation </TITLE>
  10. </HEAD>
  11. <BODY>
  12. EOP
  13.  
  14. if (length($regdata{"First Name"}) >0 && length($regdata{"Last Name"}) >0 )
  15. {
  16. print <<"EOP" ;
  17. <h3>
  18. Thank you $regdata{"First Name"} $regdata{"Last Name"} for registering with 
  19. the Leading Rein.</h3>  Please verify the following information and make
  20. any corrections necessary.
  21. EOP
  22. print "<ul>";
  23.  
  24. foreach $var (keys (%regdata) )
  25.    {
  26.    if (length($regdata{"$var"})== 0)
  27.       {
  28.       print "<li>Your <em> $var </em> will be used to help confirm your order please fill in the <em> $var </em> field" ; 
  29.       }
  30.    }
  31.  
  32. print "</ul>";
  33.  
  34. }
  35.  
  36. if (defined ($regdata{"Phone Number"} ))
  37.    {
  38.    $PhoneNumber = $regdata{"Phone Number"} ;
  39.    }
  40. else
  41.    {
  42.    $PhoneNumber ="(999) 999-9999";
  43.    }
  44.  
  45. print <<"TEST" ;
  46. <hr noshade>
  47. <center>
  48. <FORM Method=POST Action="/cgibook/chap7/reg1.cgi">
  49. <input type=hidden name=SavedName value=$regdata{"First Name"} $regdata{"Last Name"}>
  50. <table border = 0 width=60%>
  51. <caption align = top> <H3>Leading Rein Registration Form </H3></caption>
  52. <th ALIGN=LEFT> First Name
  53. <th ALIGN=LEFT colspan=2 > Last Name <tr>
  54.  
  55. <td>
  56. <input type=text size=10 maxlength=20 
  57. name="First Name" value=$regdata{"First Name"} >
  58. <td colspan=2>
  59. <input type=text size=32 maxlength=40 
  60. name="Last Name" value=$regdata{"Last Name"} > <tr>
  61. <th ALIGN=LEFT colspan=3>
  62. Street Address <td> <td> <tr>
  63.  
  64. <td colspan=3>
  65. <input type=text size=61 maxlength=61 
  66. name="Street" value="$regdata{'Street'}" > <tr>
  67. <th ALIGN=LEFT > City
  68. <th ALIGN=LEFT > State
  69. <th ALIGN=LEFT > Zip <tr>
  70. <td> <input type=text size=20 maxlength=30 
  71. name="City" value="$regdata{'City'}" >
  72. <td> <input type=text size=20 maxlength=20 
  73. name="State" value="$regdata{'State'}" >
  74. <td> <input type=text size=5 maxlength=10 
  75. name="zip" value="$regdata{'zip'}" > <tr>
  76.  
  77. <th ALIGN=LEFT  colspan=1> Phone Number 
  78. <th ALIGN=LEFT  colspan=2> Email Address <tr>
  79. <td colspan=1> <input type=text size=15 maxlength=15 
  80. name="Phone Number" value="$PhoneNumber "> 
  81. <td colspan=2> <input type=text size=32 maxlength=32
  82. name="Email Address" value=$regdata{"Email Address "> <tr>
  83. <td width=50%> <input type="submit" name="simple" value=" Submit Registration " >
  84. <td width=50%> <input type=reset> <tr>
  85. </table>
  86. </FORM>
  87. </center>
  88. <hr noshade>
  89. </body>
  90. </html>
  91. TEST
  92.  
  93.  
  94.  
  95.