home *** CD-ROM | disk | FTP | other *** search
/ Packard Bell - Internet on a CD / internet on a cd.cdr / Internet / sites / HTML_1 / multiply.pl < prev    next >
Encoding:
Perl Script  |  1998-07-16  |  603 b   |  28 lines

  1. #!/bin/perl
  2.  
  3. require "cgi-lib.pl";
  4.  
  5. print &PrintHeader;
  6.  
  7. if (&ReadParse(*input))
  8.  { 
  9.          $c = int(($input{'a'}*$input{'b'})/$input{'round'})*$input{'round'};
  10.      print '<html>';
  11.          print $input{'a'},' times ',$input{'b'},' = ',$c;
  12.      print '</html>';}
  13. else { 
  14.        print <<EOF
  15. <html>
  16. <form method="post" action="/cgi-bin/nik/multiply.pl"> 
  17. Please type in the two number which you want to multiply.<p>
  18. <input name="a"> <p>
  19. <input name="b"> <p>
  20. Round down to 
  21. <SELECT NAME="round"><OPTION SELECTED> 1
  22. <OPTION> 10 <OPTION> 100 </SELECT><p>
  23. <input type="submit"> 
  24. </form> </html>
  25. EOF
  26.   ;       }
  27.  
  28.