Connecting Tech Pros Worldwide Help | Site Map

$_POST problem with PHP5 on IIS

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 21st, 2005, 11:05 PM
will.lai@gmail.com
Guest
 
Posts: n/a
Default $_POST problem with PHP5 on IIS

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:

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

Here's the file called sendmail.php:

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

echo '$_POST: <br>';
var_dump($_POST);

echo '<p>$_GET: <br>';
var_dump($_GET);

echo '<p>$_REQUEST: <br>';
var_dump($_REQUEST);
?>

And here's the output:

5.0.5
$_POST:
array(0) { }

$_GET:
array(0) { }

$_REQUEST:
array(4) { ["ASPSESSIONIDSCQAAQQR"]=> string(24)
"HGLBCKHDEMEIMPEMCJBODHBH" ["PHPSESSID"]=> string(32)
"66c770da76c0e61c51940183f8d64e25" ["ASPSESSIONIDQASDARQR"]=>
string(24) "JBOJEPJDPLCFLLIIBJPGAEIH" ["ASPSESSIONIDQAQCBRRQ"]=>
string(24) "ACOLEPJDNBOLJIHOCOGAKJPF" }

I would appreciate any hints and suggestins. Thanks.


  #2  
Old November 21st, 2005, 11:05 PM
Anonymous
Guest
 
Posts: n/a
Default Re: $_POST problem with PHP5 on IIS

will.lai@gmail.com wrote:[color=blue]
>
> 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.[/color]

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

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

$_GET:
array(0) { }

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

Actually just what I expected. The problem must be in your server or PHP
configuration.
  #3  
Old November 21st, 2005, 11:05 PM
ZeldorBlat
Guest
 
Posts: n/a
Default 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.

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.