Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: enctype problem in CGI

by borisz (Canon)
on Mar 27, 2005 at 00:22 UTC ( [id://442568]=note: print w/replies, xml ) Need Help??


in reply to enctype problem in CGI

It works fine for me. IE:
print $q->start_form(-method => 'POST', -action=>"myAction.pl"); # <form method="post" action="myAction.pl" # enctype="application/x-www-form-urlencoded"> print $q->start_form( -method => 'POST', -enctype => &CGI::URL_ENCODED, -action=>"myAction.pl"); # <form method="post" action="myAction.pl" # enctype="application/x-www-form-urlencoded"> and print $q->start_form( -method => 'POST', -enctype => &CGI::MULTIPART, -action=>"myAction.pl"); # <form method="post" action="myAction.pl" enctype="multipart/form-dat +a">
I noticed that your output has two enctype attributes and your for has a POST method but your code does not have it. I doubt that the output is from your code.
Boris

Replies are listed 'Best First'.
Re^2: enctype problem in CGI
by chas (Priest) on Mar 27, 2005 at 00:47 UTC
    I get the method="post" with the OP's code. That seems to be the default if you didn't specify a method, at least in the version of CGI.pm that I have (2.752 I believe.)
    chas
Re^2: enctype problem in CGI
by macPerl (Beadle) on Mar 27, 2005 at 00:47 UTC

    Boris

    That IS the output from the code.

    POST is the default method - so the fact that my code does not have it means nothing.

    If you re-read the my post you will see the ENCTYPE is the source of my confusion. Of course there should only be one. Of course, the default should be "application/x-www-form-urlencoded".

    Any other ideas ?

      Yes, use the encoding type explicit in your code. Since it looks, the default has changed.
      print $q->start_form( -enctype => "application/x-www-form-urlencoded", -action=>"myAction.pl");
      Boris

        Boris,

        as per the posted code ... tried & failed (both ways)

        -enctype => "application/x-www-form-urlencoded"

        and

        -enctype=>&CGI::URL_ENCODED

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://442568]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-25 07:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found