I'm trying to write a forum-like simple cgi to get feedback from customers who visited my site.
I had this code:
to handle both "POST" or "GET" method.Code:if ($request_method eq "GET") { $query_string = $ENV{'QUERY_STRING'}; } elsif ($request_method eq "POST") { read (STDIN, $query_string, $ENV{'CONTENT_LENGTH'}); }
But when it runs, "GET" works; but "POST" doesn't.
After a while, I realised it was $ENV{'CONTENT_LENGTH'} that created the error. How come? I thought that was standard stuff?


Reply With Quote

Bookmarks