Thanks, But please see what I sent to jzed here and provide any input if you could >> Not sure exactly what you mean... I edited my script like this and it's still not working. If I move my print "Content-type: text/html\n\n"; things will not work correctly. Also I have no idea how to use CGI.pm's header and redirect methods. This book doesn't go into depth nearly enough to complete these assignments. This is frustrating for me Any help? I am a novice. This is my first Perl Class. Thanks,
#!c:\phpdev\perl\bin\perl.exe #c12ex3.cgi - Location Header print "Content-type: text/html\n\n"; use CGI qw(:standard -debug); #prevent Perl from creating undeclared variables use strict; #declare variables my ($Salesperson, $Sales, $Size, $Rate, $Percentage, @records, @errors +, $errors, $bonus); #assign input items to variables $Salesperson = param('Salesperson'); $Sales = param('Sales'); $Rate = param('Rate'); $Percentage = param('Percentage'); #calculate bonus rates $bonus = $Rate * $Sales; if ($Salesperson eq "") { print "Location: http://localhost/cgi-bin/c12ex3b.html\n\n"; } elsif ($Sales == "") { print "Location: http://localhost/cgi-bin/c12ex3b.html\n\n"; } elsif ($Rate == "") { print "Location: http://localhost/cgi-bin/c12ex3b.html\n\n"; } else { print "<HTML>\n"; print "<HEAD><TITLE>Patton Industries</TITLE><BASEFONT SIZE=5></HEAD>\ +n"; print "<H1>Bonus Calculation</H1>\n"; print "<BODY>\n"; print "Salesperson: $Salesperson<BR>\n"; printf "Your bonus is: \$%.2f<BR><BR>\n", $bonus; printf "You entered a sales amount of \$%.2f and a \n", $Sales; printf "bonus rate of %.1f%%.<BR>\n", $Rate * 100; print "</BODY>\n"; print "</HTML>\n"; print "</BODY></HTML>\n"; }

In reply to Re^2: HTTP headers and redirection by student
in thread HTTP headers and redirection by student

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.