perl help
jmoney3457
Maine
anyone here good/know perl? im having some trouble adding background image & changing font & size here
0
Comments
You need to sit down with an HTML & CSS intro book for an afternoon before you get into Perl.
Pro tip: Never, ever use the "font" tag. Ever.
that being said.. keebs makes mention of a wonderful bit of technology called css. you could be outputting html from perl but using css to control the look and feel of your end result. might be easier than hard coding colors and font sizes in your script.
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "<html><head><title> Grades</title></head> <body>";
print "<body bgcolor=yellow>\n";
$grade = 67;
$grade2 = 75;
$grade3 = 67;
$grade4 = 75;
$grade5 = 70;
$grade6 = 65;
$average = ($grade + $grade2 + $grade3 + $grade4 + $grade5 + $grade6) / 6;
$cubedgrade = 3 ** 3;
$onemore = $cubedgrade + 1;
$remainder = #onemore % 3;
print "grade 1 is $grade\n<br>";
print "grade 2 is $grade2\n<br>";
print "grade 3 is $grade3\n<br>";
print "grade 4 is $grade4\n<br>";
print "grade 5 is $grade5\n<br>";
print "grade 6 is $grade6\n<br>";
print "the average of all the grades is $average\n<br>";
print "3 cubed is $cubedgrade<br>";
print "one more than the cubed grade is $onemore<br>";
print "The remainder is $remainder<br>";
############################
if($average >= 93){
print "<font color=blue>hey you got an A!";
print "</font><br>";
}
elsif($average >= 82) {
print "<font color=orange>hey you got a B";
print "</font><br>";
}
elsif($average >= 70) {
print "<font color=purple>hey you got a C";
print "</font><br>";
}
elsif($average >= 65) {
print "<font color=green>hey you got a D";
print "</font><br>";
}
elsif($average <= 64) {
print "<font color=brown>hey you got a F";
print "</font><br>";
}
print "This is the end";
oops thx keeb ok code & PHP didn't seem to help either so ive uploaded it as notepad attachment any help on getting BG image & different font style/size using CSS would be helpful:)
< font color="green" >
NOT:
< font color=green >
However, like I said, you should never, ever use the font tag. Use CSS. I can't teach you CSS in a forum post - I highly recommend the linked book above if you're going to continue making websites. Trying to tackle Perl before learning HTML/CSS is totally backwards.
good luck.