CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Reading posted form data from STDIN

 



barber
Deleted

May 4, 2000, 9:55 AM

Post #1 of 5 (993 views)
Reading posted form data from STDIN Can't Post

For the last two days I've been trying to figure out an internal server error that occurs when I try and read posted form data from STDIN (at least it doesn't occur when I comment the read statement out). The script runs through a university web server running Apache 1.3.4, CGIWrap and perl 4.0.1.8. Here is the current form of the script (I've tried a million variations). Any help would be greatly appreciatted, because I'm out of ideas.

#!/usr/local/bin/perl

$|=1;

local($DataString);
read(STDIN,$DataString,$ENV{CONTENT_LENGTH});

print "Content-type: text/html\n\n";

print "<HTML><HEAD><TITLE></TITLE></HEAD><BODY>";

print "</BODY></HTML>";


monocle
User

May 3, 2000, 10:28 PM

Post #2 of 5 (993 views)
Re: Reading posted form data from STDIN [In reply to] Can't Post

It would appear that you left out the single quote around CONTENT_LENGTH. I copied this line from a script that I know is working:
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});

Hope this helped. Good luck!

Monocle
Hear great techno music by Monocle at http://www.mp3.com/monocle

[This message has been edited by monocle (edited 05-04-2000).]


barber
Deleted

May 4, 2000, 11:03 AM

Post #3 of 5 (993 views)
Re: Reading posted form data from STDIN [In reply to] Can't Post

Hi

I tried quotes, although I've seen it both with and without them. Same result.

Thanks tho


monocle
User

May 4, 2000, 12:52 PM

Post #4 of 5 (993 views)
Re: Reading posted form data from STDIN [In reply to] Can't Post

hmmm.... that's a tough one. As I mentioned before, that line works on my server, also running apache.

If you have access to your error log it would help to have the information that is being logged about this error. I know I used to struggle with debugging until I was able to view my error log. Now it pretty much tells me what and where the problem is.


barber
Deleted

May 4, 2000, 1:05 PM

Post #5 of 5 (993 views)
Re: Reading posted form data from STDIN [In reply to] Can't Post

Sorry, forgot to mention that I had checked the logs. Oddly, there was nothing in the error logs. However, in the access logs have the following

[02/May/2000:11:51:45 -0600] "POST /cgi-bin/cgiwrap/barber/FormHandler.cgi HTTP/1.0" 500 604

From this I can figure out the 500 part (internal server error .etc) but I haven't been able to find anything about the 604 part.

I'm starting to think that the server may not be configured to allow me to use the post method.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives