This is a discussion on POST wont work, GET instead within the Linux Web Servers forums, part of the Web Server and Related Forums category; Hello- Ive encountered a problem while setting up a website on my local network. I have 3 machines on my ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hello-
Ive encountered a problem while setting up a website on my local network. I have 3 machines on my 192.168 network. My apache 2.0.47 is setup on my linux box. When I access the page on that machine it comes up fine. When I access it on the other 2 machines I get a method error...instead of POSTing it submits a GET instead. Any ideas? I havent gotten it to work ever yet so its nothing I can go back to to find out what changed. TIA -- But mark this: There will be terrible times in the last days. People will be lovers of themselves, lovers of money, boastful, proud, abusive, disobedient to their parents, ungrateful, unholy, without love, unforgiving, slanderous, without self-control, brutal, not lovers of the good, treacherous, rash, conceited, lovers of pleasure rather than lovers of God-- having a form of godliness but denying its power. Have nothing to do with them. - 2Timothy 3:1-5 (NIV) |
|
|||
|
jeep@52.usenet.us.com wrote:
> Hello- > > Ive encountered a problem while setting up a website on my local > network. I have 3 machines on my 192.168 network. My apache 2.0.47 > is setup on my linux box. When I access the page on that machine it > comes up fine. Can you post a link to the page, or at least show us how you are accessing it? Are you actually hitting a submit button on the page and doing a post in the form tag? -- -Scott yanoff@STOP-SPAMMINGyahoo.com | http://www.yanoff.org | AOL IM: SAY KJY |
|
|||
|
Ive reduced the html file to:
<html> <head> <body> <center> <h2> <form method="POST" action="http://www.ptsdsurvey.com/cgi-bin/mil_civ.pl"> <input type="hidden" name="mil_civ" value="military"> <input type="image" src="http://www.ptsdsurvey.com/mil_button.jpg" alt="Military"> </form> <form method="POST" action="http://www.ptsdsurvey.com/cgi-bin/mil_civ.pl"> <input type="hidden" name="mil_civ" value="civilian"> <input type="image" src="http://www.ptsdsurvey.com/civ_button.jpg" alt="Civilian"> </form> </body> </html> And my perl script (just the first part) is: #!/usr/bin/perl -w # use strict; my $BASE; BEGIN { $BASE="/var/www"; } use lib "$BASE/perl_inc"; require "fileIO.pl"; require "html_utils.pl"; require "gen_numbers.pl"; require "ptsd.pl"; # setup variables we will use here my $HTML_DIR="/var/www/ptsdsurvey"; my $MILITARY_FILE="$HTML_DIR/MilitaryConsentForm.htm"; my $CIVILIAN_FILE="$HTML_DIR/CivilianConsentForm.htm"; # set the MIME header print "Content-type: text/html\r\n\r\n"; my $buffer; if ($ENV{'REQUEST_METHOD'} eq "POST") { read(STDIN,$buffer,$ENV{'CONTENT_LENGTH'}); } else { my $meth = $ENV{'REQUEST_METHOD'}; print STDERR "ERROR: Method Error ($meth)\n"; errhtml("Method Error ($meth)"); exit 1; } I get the method error saying: ERROR: Method Error (GET) in my apache log and the html error page I post. Im behind a gateway router box as well. Im unsure if this has anything to do with anything. I have never seen a POST end up as a GET during small html development, so Im lost. Thanks! -- Do not say, "Why were the old days better than these?" For it is not wise to ask such questions. - Ecclesiastes 7:10 (NIV) |
|
|||
|
jeep@52.usenet.us.com writes:
> Im behind a gateway router box as well. Im unsure if this has anything > to do with anything. I have never seen a POST end up as a GET during > small html development, so Im lost. Set up a client side proxy to dump out the html coming from your script, and make sure it's sending a POST. I usually use Junkbuster for that because it's convenient (junkbuster.org) and there's debug options to dump out the incoming html and so forth. |
|
|||
|
jeep@52.usenet.us.com wrote:
> And my perl script (just the first part) is: > # set the MIME header > print "Content-type: text/html\r\n\r\n"; Just for kicks, right here can you try printing out the $ENV{'REQUEST_METHOD'}? I know you print it later but I just want to make sure it is not getting corrupted in some way. > if ($ENV{'REQUEST_METHOD'} eq "POST") Your script looks correct. Just for kicks, see what happens when you change this line to: if ($ENV{'REQUEST_METHOD'} =~ /POST/i) so that it does a pattern match... in case there are extra characters in the ENV variable. There shouldn't be, but let's rule it out right away. -- -Scott yanoff@STOP-SPAMMINGyahoo.com | http://www.yanoff.org | AOL IM: SAY KJY |