Sorry, setting up the CGI object was useless in that case, since I didn't
use the object to create the fields. My bad. Sorry.



-----Original Message-----
From: Scot Robnett [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 15, 2002 6:13 PM
To: Jessica Ortiz; [EMAIL PROTECTED]
Subject: RE: html in a cgi script


Jessica, most of the information you are looking for is available in the
help documentation for CGI.pm. Try 'perldoc CGI.pm' and go through it until
you find the form examples. Here's a *very* basic example of a form with a
select menu:


#!/usr/bin/perl
use CGI;
use strict;
my $q = new CGI;
print
 header;
  start_html('Test Form'),
  h2('Test Form'),
   start_form,
   "First Name: ",textfield('firstname'),
   "Last Name: ",textfield('lastname'),
   "How would you rate your good looks?",
   popup_menu(-name=>'rating',
              -values=>['1','2','3','4','5','6',
                        '7','8','9',10']),
   p,
   submit,
   end_form,
  hr;
print end_html;








-----Original Message-----
From: Jessica Ortiz [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 15, 2002 2:00 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: html in a cgi script


Hi Scott,
I am in the same boat like Matthew here.
Do you have any examples to implement selection list boxes, text boxes, as
well as checkboxes?

I'd just like to see how you would do that using this style of html:
use CGI;       # use CGI.pm
$q = new CGI;  # initiate a new CGI object
$q->header();  # write an HTTP header to the browser

$q->start_html; # start the HTML doc
$q->title('Matt\'s Test HTML Page'); # write a title
$q->h3('Matt\'s Test HTML Page');    # write an <h3>
$q->p('This is an HTML page without the fancy stuff.'); # <p>
$q->end_html; # end the HTML doc

Thanks.

Jessica


>From: "Scot Robnett" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Subject: RE: html in a cgi script
>Date: Mon, 11 Mar 2002 11:39:32 -0600
>
>Matt,
>
>CGI.pm has some decent functionality for print HTML from Perl, if you are
>not worried about making your pages look pretty. It does offer some limited
>support for style sheets, but usually if I want my HTML to look nice, I
>just
>use a HERE doc. You should be able to save the following example as a .cgi
>or .pl file on your server and run it as long as you have the file
>permissions set to executable.
>
>######## snip #########
>
>#!/usr/bin/perl
>
>use CGI;       # use CGI.pm
>$q = new CGI;  # initiate a new CGI object
>$q->header();  # write an HTTP header to the browser
>
># This is the HERE document:
>
>print <<END_OF_HTML;
>  <html>
>  <head>
>  <title>Matt's Test HTML Page</title>
>  </head>
>  <body bgcolor="#cccccc">
>  <h3>Matt's Test HTML Page</h3>
>  <font face="Verdana" size="2">
>  This is a page with a gray background using the <b>Verdana</b> font.
>  </font>
>  </body>
>  </html>
>END_OF_HTML
>
># Make sure you have at least one carriage return
># at the end of the HERE document.
>
>######## snip #########
>
>
>
>A more basic HTML document could have been done using CGI.pm, but without
>the style control:
>
>######## snip #########
>
>use CGI;       # use CGI.pm
>$q = new CGI;  # initiate a new CGI object
>$q->header();  # write an HTTP header to the browser
>
>$q->start_html; # start the HTML doc
>$q->title('Matt\'s Test HTML Page'); # write a title
>$q->h3('Matt\'s Test HTML Page');    # write an <h3>
>$q->p('This is an HTML page without the fancy stuff.'); # <p>
>$q->end_html; # end the HTML doc
>
>######## snip #########
>
>
>You can add style to HTML documents generated with a CGI object. For that,
>read the perldoc on CGI.pm about style sheets.
>
>Scot Robnett
>inSite Internet Solutions
>[EMAIL PROTECTED]
>www.insiteful.tv
>
>
>
>
>
>-----Original Message-----
>From: Matthew Harrison [mailto:[EMAIL PROTECTED]]
>Sent: Monday, March 11, 2002 11:22 AM
>To: [EMAIL PROTECTED]
>Subject: html in a cgi script
>
>
>I am just starting to learn perl and am reading about cgi.pm
>I have read about creating an appropriate header and using the start_html
>line, but can someone please give me an example of their html inside a
>script?
>
>TIA
>
>--
>Matthew Harrison
>Internet/Network Services Administrator
>Peanut-Butter Cheesecake Hosting Services
>genestate
>www.peanutbuttercheesecake.co.uk
>
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>---
>Incoming mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.333 / Virus Database: 187 - Release Date: 3/8/2002
>
>---
>Outgoing mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.333 / Virus Database: 187 - Release Date: 3/8/2002
>
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>




_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.333 / Virus Database: 187 - Release Date: 3/8/2002

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.333 / Virus Database: 187 - Release Date: 3/8/2002


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.333 / Virus Database: 187 - Release Date: 3/8/2002

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.333 / Virus Database: 187 - Release Date: 3/8/2002


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to