$_POST problem with PHP5 on IIS

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi:  Just learning PHP and couldn't get access to the $_POST variables
from a form.  Here are my code sniplets below.  For the life of me I
can't figure out why the POST variables aren't being passed.  FYI, if I
switch the method to GET and the $_GET variable works great.

Here's the feedback.html:

   <head><title>Feedback form</title></head>
   <form action="sendmail.php" method="POST">
     Email: <input name="email" type="text">
     <input type="submit" value="submit">

Here's the file called sendmail.php:

   echo phpversion();
   echo '<p>';

   echo '$_POST: <br>';

   echo '<p>$_GET: <br>';

   echo '<p>$_REQUEST: <br>';

And here's the output:

   array(0) { }

   array(0) { }

   array(4) { ["ASPSESSIONIDSCQAAQQR"]=> string(24)
"66c770da76c0e61c51940183f8d64e25" ["ASPSESSIONIDQASDARQR"]=>

I would appreciate any hints and suggestins.  Thanks.

Re: $_POST problem with PHP5 on IIS

will.lai@gmail.com wrote:
Quoted text here. Click to load it

I couldn't see anything wrong with the code, so I just tried it out to
see what the server says:

array(1) { ["email"]=> string(17) "test@test.invalid" }  

array(0) { }  

array(1) { ["email"]=> string(17) "test@test.invalid" }  

Actually just what I expected. The problem must be in your server or PHP

Re: $_POST problem with PHP5 on IIS

Check your IIS configuration and see what verbs are permitted for PHP.
My guess is that POST isn't included.  You should have GET and POST
enabled at a minimum, or just make your life easy and allow all verbs.

Site Timeline