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
In reply to enctype problem in CGI by macPerl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |