macPerl has asked for the wisdom of the Perl Monks concerning the following question:
Monks,
Using CGI I have the following code
#! /usr/bin/perl use CGI; use strict; my $q = new CGI; print $q->header; print $q->start_html(-title=>'macCopy'); print $q->start_form(-enctype=>&CGI::URL_ENCODED, -action=>"myAction.p +l"); print $q->submit(-name=>'submit', -value=>'GoForIt'); print $q->hidden('hidKey','hidVal'); print $q->endform; print $q->end_html;
and it creates the following
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US"> <head> <title>macCopy</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> </head> <body> <form method="post" action="myAction.pl" enctype="multipart/form-data" enctype="application/x-www-form-urlencoded"> <input type="submit" tabindex="1" name="submit" value="GoForIt" /><input type="hidden" name="hidKey" value="hidVal" /> </form> </body> </html>
Please note the "enctype" in the FORM tag
I am looking for enctype ="application/x-www-form-urlencoded"
When I omit the -enctype=>&CGI::URL_ENCODED option in start_form to try to get the default value (which should be application/x-www-form-urlencoded)it still defaults to enctype="multipart/form-data"
Can anyone put me right and explain why this is happening ?
Thanks in advance
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: enctype problem in CGI
by merlyn (Sage) on Mar 27, 2005 at 00:38 UTC | |
by Errto (Vicar) on Mar 27, 2005 at 04:16 UTC | |
by macPerl (Beadle) on Mar 27, 2005 at 01:00 UTC | |
by merlyn (Sage) on Mar 27, 2005 at 01:02 UTC | |
by macPerl (Beadle) on Mar 27, 2005 at 01:20 UTC | |
by BrentDax (Hermit) on Mar 27, 2005 at 19:39 UTC | |
| |
Re: enctype problem in CGI
by chas (Priest) on Mar 27, 2005 at 00:16 UTC | |
Re: enctype problem in CGI
by borisz (Canon) on Mar 27, 2005 at 00:22 UTC | |
by chas (Priest) on Mar 27, 2005 at 00:47 UTC | |
by macPerl (Beadle) on Mar 27, 2005 at 00:47 UTC | |
by borisz (Canon) on Mar 27, 2005 at 00:55 UTC | |
by macPerl (Beadle) on Mar 27, 2005 at 01:07 UTC | |
by borisz (Canon) on Mar 27, 2005 at 01:16 UTC | |
| |
Re: enctype problem in CGI
by artist (Parson) on Aug 29, 2006 at 15:45 UTC | |
Re: enctype problem in CGI
by thewebsi (Scribe) on Nov 13, 2007 at 02:02 UTC | |
by avarus (Novice) on Apr 15, 2008 at 09:23 UTC | |
by macPerl (Beadle) on May 14, 2008 at 10:14 UTC |
Back to
Seekers of Perl Wisdom