perl help

jmoney3457jmoney3457 Maine
edited October 2007 in Internet & Media
anyone here good/know perl? im having some trouble adding background image & changing font & size here

Comments

  • edited October 2007
    how bout some source code?
  • jmoney3457jmoney3457 Maine
    edited October 2007
    lightnin wrote:
    how bout some source code?
    eh?:confused:
  • edited October 2007
    um... you needed perl help right? or do you need html help? i was asking for the perl source code... cant fix the problem if i cant see it. your link is to generated html, so i have no idea if you need html tweaks or if there's some nasty perl bug causing hiccups.
  • LincLinc Owner Detroit Icrontian
    edited October 2007
    jmoney3457 wrote:
    im having some trouble adding background image & changing font & size here
    Perl has nothing to do with changing font and size in HTML. Perl is a server-side scripting language that spits out the HTML (and possibly CSS) to the browser; it doesn't directly control styling itself.

    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. ;)
  • edited October 2007
    unless he's changing font size, color, and backgrounds with perl before the html is sent client side. still could be a perl issue....

    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.
  • jmoney3457jmoney3457 Maine
    edited October 2007
    sorry bout that lol now i know what you mean here it is..im trying to insert font style/size etc & BG image w/ css:
    #!/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";
  • LincLinc Owner Detroit Icrontian
    edited October 2007
    You didn't wrap the code in "PHP" or "code" tags, so the forum converted the HTML to VB code and it's unreadable now. I strongly suspect this is not a Perl problem, it's an HTML problem (you're printing incorrect HTML, not screwing up Perl code).
  • jmoney3457jmoney3457 Maine
    edited October 2007
    Keebler wrote:
    You didn't wrap the code in "PHP" or "code" tags, so the forum converted the HTML to VB code and it's unreadable now. I strongly suspect this is not a Perl problem, it's an HTML problem (you're printing incorrect HTML, not screwing up Perl code).

    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:)
  • LincLinc Owner Detroit Icrontian
    edited October 2007
    When you assign an attribute to an HTML tag like color, the value needs to be in quotes. So it's:

    < 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.
  • edited October 2007
    yeah keebs is right... it's not perl per se you're having a problem with. being more familiar with the fundamentals of html syntax and structuring will help you a ton in the long run... it's not too difficult. once you can do html/css pretty well then webapps will come together much easier for you.

    good luck.
  • jmoney3457jmoney3457 Maine
    edited October 2007
    these are just for college class nothing else lol but don't i need like the intro CSS tag?
  • LincLinc Owner Detroit Icrontian
    edited October 2007
    If you want to embed CSS in the same document, you need to put it in the document head inside < style > tags. Seriously... you need a reference and/or tutorial book for this.
Sign In or Register to comment.