You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by "Alexei V. Barantsev" <ba...@kazbek.ispras.ru> on 2000/07/08 09:43:59 UTC
CGI.pm: start_form defaults
Playing with CGI I have found that real behaviour of start_form
without parameters does not correspond to documentation.
Re: CGI.pm: start_form defaults
Posted by "Alexei V. Barantsev" <ba...@kazbek.ispras.ru>.
Hasanuddin Tamir <ha...@trabas.com> writes:
> >> No wonder Alexei V. Barantsev on Jul 8 said that,
>
> AVB] Playing with CGI I have found that real behaviour of start_form
> AVB] without parameters does not correspond to documentation.
> AVB]
> AVB] >From the documentation:
> AVB]
> AVB] The defaults are:
> AVB] method: POST
> AVB] action: this script
> AVB] enctype: application/x-www-form-urlencoded
> AVB]
> AVB] >From the source code of startform:
> AVB]
> AVB] $method = $method || 'POST';
> AVB] $enctype = $enctype || &URL_ENCODED;
> AVB] $action = $action ? qq/ACTION="$action"/ : $method eq 'GET' ?
> AVB] 'ACTION="'.$self->script_name.'"' : '';
>
> Yes, it's empty. And when it is, according to HTML spec,
> the default ACTION will be "this script". So the doc is
> just fine.
>
According to HTML 4.0 specification attribute 'action' of FORM element
is required. From DTD of "-//W3C//DTD HTML 4.0//EN":
<!ATTLIST FORM
%attrs; -- %coreattrs, %i18n, %events --
action %URI; #REQUIRED -- server-side form handler --
method (GET|POST) GET -- HTTP method used to submit the form--
enctype %ContentType; "application/x-www-form-urlencoded"
...
--
ab
ICQ: 3959207
Re: CGI.pm: start_form defaults
Posted by Hasanuddin Tamir <ha...@trabas.com>.
>> No wonder Alexei V. Barantsev on Jul 8 said that,
AVB] Playing with CGI I have found that real behaviour of start_form
AVB] without parameters does not correspond to documentation.
AVB]
AVB] >From the documentation:
AVB]
AVB] The defaults are:
AVB] method: POST
AVB] action: this script
AVB] enctype: application/x-www-form-urlencoded
AVB]
AVB] >From the source code of startform:
AVB]
AVB] $method = $method || 'POST';
AVB] $enctype = $enctype || &URL_ENCODED;
AVB] $action = $action ? qq/ACTION="$action"/ : $method eq 'GET' ?
AVB] 'ACTION="'.$self->script_name.'"' : '';
Yes, it's empty. And when it is, according to HTML spec,
the default ACTION will be "this script". So the doc is
just fine.
san
--
trabasLabs * hasant@trabas.com * http://www.trabas.com
Zero Point * hasant@zp.f2s.com * http://www.zp.f2s.com
------------------------------------------------------
We are all alone.... --The X-Files