Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

novie perl-CGI user

by novitiate (Scribe)
on Mar 19, 2001 at 20:15 UTC ( #65437=perlquestion: print w/replies, xml ) Need Help??

novitiate has asked for the wisdom of the Perl Monks concerning the following question:

creating web based analogues to the standard ms win32 "net x-command" set. i have it working, but as a spiritual exercise, i decided to change GET to POST. in a reversal of forutne, nothing works now. I will occasinally get the expected result back, but often (especially after repeating a previously sent POST) i get a 500, click on refresh, and there it is, as it should be. Here is the form code:
sub form() { print $doc->start_multipart_form(-name=>'form1', -method=>'POST', -action=>'netsession.cgi', -enctype=>'multipart/form-data'); print $doc->textfield(-name=>'computer', -size=>15, -maxlength=>15, -override=>1); print "&nbsp&nbsp&nbsp&nbsp"; print $doc->submit(); print "&nbsp&nbsp"; print $doc->reset(); print $doc->end_mulitpart_form(); }
I have tried putting an expires (yesterday) header in, but it does not seem to work. I also changed $| to a true value. I am running Apache for Win32 version 1.3.12. on WinNT 4 sp 6a, activestate perl 5.6.0. Latest glory be to god

Replies are listed 'Best First'.
Re: novie perl-CGI user
by mkmcconn (Chaplain) on Mar 19, 2001 at 20:52 UTC
    If you aren't doing so, you might try using
    use CGI::Carp qw(fatalsToBrowser);
    This might provide us with a little more diagnostic info to work with.


      ok. it reports malformed multipart POST (same as the logs). sniffer seems to show, that at times, the browser will send a POST with an Authentication header and no post following. At other times, there are two posts, one for Authentication and the next for the form data after the users has been verified. I took authentication off and nothing was solved.
Re: novie perl-CGI user
by mkmcconn (Chaplain) on Mar 20, 2001 at 00:27 UTC

    novitiate, all I can think of saying is, there are some small infelicities in your function that are probably not related to the problem you are having.

    • I think you don't really want to prototype form() since it probably appears too late in your program anyway - so, remove the parens.
    • You don't need to tell start_multipart_form() to use -enctype=>'multipart/form-data', because adding that parameter is about the only thing this alias for the start_form() function does.
    • You can concatenate all of your consecutive print statements, using a comma (Replace the semi-colons with commas and remove the prints between). I suppose this might have a cost for building the string, but I can't imagine that it would be as expensive as calling print for every string fragment.
    I regret that there isn't more here that's helpful to your specific problem; I wasn't able to reproduce your errors, and lacking your netsession.cgi probably can't. But, hopefully, there might be something useful in what I did think of saying.


Re: novie perl-CGI user
by novitiate (Scribe) on Mar 19, 2001 at 20:26 UTC
    update that code, last call to CGI object is not
    print $doc->end_multipart_form();
    print $doc->end_form();

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://65437]
Approved by root
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2023-06-02 08:28 GMT
Find Nodes?
    Voting Booth?

    No recent polls found