Sorry, I posted that directly to you and not to the group.  My mistake...

matt

-----Original Message-----
From: Boex,Matthew W. 
Sent: Monday, October 08, 2001 12:58 PM
To: 'Brett Sanger'
Subject: RE: [htmltmpl] another question


Brett,

Thanks for the reply.  Below is a snipet of my cgi ( it is pretty big.  if
you want i can send ).  As you can see, I did comment out some of the cgi
params, I just wanted to get the textbox and submit to work first  -  Here
are the params and the snipet of code below.

print $q->start_form;
print $q->textfield(-name=>"listing"),$q->br,$q->submit(-name=>"by_listing",
-value=>"Go!");

Also,  I attached the template file.  Let me know if you can read it or not.

Matt

----------------------------------------------------------
#!/usr/bin/perl -w

use CGI;
use DBI;
use HTML::Template;

my $q = new CGI;

my $template = HTML::Template->new(filename => 'temp.tmpl', associate =>$q
);

print_firstpage() if (!$q->param());
print_search_by_listing() if ($q->param("by_listing"));
print_search_by_state() if ($q->param("search_by_state"));


sub print_firstpage { 

my @states =
("Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticu
t","Delaware","District of
Columbia","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","
Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan"
,"Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New
Hampshire","New Jersey","New Mexico","New York","North Carolina","North
Dakota","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South
Carolina","South
Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West
Virginia","Wisconsin","Wyoming");

my @types = ("All-Types","Single
Family","Condo/Townhome","Duplex/Triplex","Vacant/Land","Commercial","Farm/R
anch","Rental Only","Timeshare","Other");
    #print $q->header;
    print $q->start_form;
    print
$q->textfield(-name=>"listing"),$q->br,$q->submit(-name=>"by_listing",
-value=>"Go!");
    
    #print $q->popup_menu(-name=>"by_state", -values=>\@states);
    #print $q->popup_menu(-name=>"types", -values=>\@types);
    #print $q->radio_group(-name=>"sort_by",
-value=>["location","price","bedrooms"], -default=>"location",
-linebreak=>1);
    #print $q->submit(-name=>"search_by_state", -value=>"Go!"),$q->end_form;
    print $template->output;
} 

-----Original Message-----
From: Brett Sanger [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 08, 2001 11:27 AM
To: Boex,Matthew W.
Subject: Re: [htmltmpl] another question


> [Mon Oct  8 10:48:31 2001] [error] [client 127.0.0.1] malformed header
from
> script. Bad header=<FORM METHOD="POST"  ENCTYPE=":
> /var/www/cgi-bin/mini-mychicago.cgi

This means that the FORM line was the first line it saw.

> i am not printing the header info since my html template has <META
> HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html;  charset=iso-8859-1">.  now,
i

No good, that's not a real header.  Print out $q->header anyway.

> added a print $q->header in my cgi and it did print my form, just at the
top
> of the page, not where i have the var inserted.

As noted by the logfile entry, the FORM line was the first it encountered.
At this point I think there is something wrong with your templates.  Are
they simple enough to show?

> do i need to add <FORM METHOD="POST"
> ENCTYPE="application/x-www-form-urlencoded"> to my html template file?

No, that is unrelated.

Think of it as unrelated parts:  A header identifies the content.  This is
the Content-Type=text/html that is $q->header, and must be the first line.

Unrelated to that is the content of the page, which is presumably put out
by your template.  The content has no relation to the header (other than
they should agree that it's HTML).

A FORM tag indicates the beginning of a form.  It will not affect the
display of the rest of the page.



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

Reply via email to