Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Hail brother monks,

I am trying to write a little perl script that makes use of CGI.pm and am having trouble understanding a couple of things. Here is what I have done so far:

#!/usr/local/bin/perl -w use strict; use CGI qw/:standard/; # load standard CGI routines my $query = new CGI; print $query->header(type=>'image/gif'); print $query->start_html(title=>'PMI Human Resources', author=>'berry-kelly@pmimail.com', meta=>{'keywords'=>'PMI HR HumanResources', 'copyright'=>'copyright 2001 Kelly Be +rry'}, style=>{'src'=>'style.css'}, BGCOLOR=>'blue'); print $query->start_form(method=>'post', action=>'editpositions.pl') +; print "What is the Job Title?"; print $query->textfield('JobTitle','',30,80); print "<br><br>What is the Date Listed?"; print $query->textfield('DateListed','',30,80); print "<br><br>What is the Job Description?<br>"; print $query->textarea('Description','',10,80);
As you can see this is not real difficult stuff, but I don't get the results I expect. According to the CGI docs:
"Any additional attributes you want to incorporate into the <BODY> tag(as many as you like). This is a good way to incorporate other Netscape extensions, such as backgroung color and wallpager pattern.

This code doesn't change the bgcolor, it just print BGCOLOR on my html page. Also is there a way to put a BACKGROUND image on the page? Any help would be appreciated...

Prince99 bangs his head against the wall in frustration.


Prince99
Too Much is never enough...

Edit by tye


In reply to HTML Tag attribute problems with CGI.pm by Prince99

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2024-03-28 08:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found