in reply to LWP form post example not working

Are you sure that http://www.(mypath)/login.php actually takes "username" and "password" as post variables? I used this as my login.php:
<?php foreach($_POST as $key => $value) { if(is_array($value)) { $newvalue = implode(',',$value); //if it's an array, convert i +t to comma separated } else { $newvalue = $value; } print "$key: $newvalue\n"; } ?>
and got this response:
HTTP/1.0 200 OK
Connection: close
Date: Fri, 10 Oct 2008 21:04:38 GMT
Server: Apache
Content-Type: text/html
Client-Date: Fri, 10 Oct 2008 21:54:51 GMT
Client-Response-Num: 1
X-Powered-By: PHP/5.2.5

username: masked
password: masked
That leads me to believe that the script is correct, but that what login.php is expecting is different. If you are using Firefox you could try the TamperData extension to see what exactly the form is supposed to be submitting.
--
andrew

Replies are listed 'Best First'.
Re^2: LWP form post example not working
by perlchild (Acolyte) on Oct 14, 2008 at 14:47 UTC
    Yes the variables are post variables, I know since I created the form myself. There is also a hidden redirect variable that goes in the url.

      Can you put a simpler page (like the one I posted) that just displays the POST variables it receives and test that?

      It really sounds like a problem on the PHP side. I would recommend that you look at the PHP and see how it decides which content to show, then do some diagnostics on why it is failing to work like you expect.

      --
      andrew
        You know, your right! I gave you a vote. I will take a good long look at what I am doing in the PHP code and track down why it is not working correctly. Thanks for the help.