ant has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
Its been a while.
Here's a snippet of my code
howvever, when I replace print header with print "Content-type: text/html","\r\n\r\n"; it all works fine. It seems with print header the STDIN cannot read the HTML form. Below this code, the HTML is formed with the form tag and method = 'post'.
Any ideas why this way worked would be great.
Cheers
Ant
Its been a while.
Here's a snippet of my code
The output is 'could not execute query 'print header(); if ($ENV{'REQUEST_METHOD'} eq 'POST') { read (STDIN, $input, $ENV{'CONTENT_LENGTH'}) || print "could not e +xecute query <br>"; print "got into POST - $input $ENV{'CONTENT_LENGTH'} <br>" . <STDI +N>; @pairs = split(/&/, $input); }
howvever, when I replace print header with print "Content-type: text/html","\r\n\r\n"; it all works fine. It seems with print header the STDIN cannot read the HTML form. Below this code, the HTML is formed with the form tag and method = 'post'.
Any ideas why this way worked would be great.
Cheers
Ant
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: CGI Post query
by gellyfish (Monsignor) on Jul 05, 2006 at 09:28 UTC | |
by ant (Scribe) on Jul 05, 2006 at 09:53 UTC | |
by merlyn (Sage) on Jul 05, 2006 at 14:20 UTC | |
by ant (Scribe) on Jul 06, 2006 at 08:38 UTC | |
by gellyfish (Monsignor) on Jul 06, 2006 at 08:51 UTC | |
by cowboy (Friar) on Jul 05, 2006 at 17:58 UTC | |
Re: CGI Post query
by gellyfish (Monsignor) on Jul 05, 2006 at 08:38 UTC | |
by ant (Scribe) on Jul 05, 2006 at 09:02 UTC | |
Re: CGI Post query
by wazoox (Prior) on Jul 05, 2006 at 08:18 UTC | |
by ant (Scribe) on Jul 05, 2006 at 08:41 UTC | |
by davorg (Chancellor) on Jul 05, 2006 at 08:50 UTC |
Back to
Seekers of Perl Wisdom