473,326 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

$_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.

Nov 22 '05 #1
2 8437
wi******@gmail.com wrote:

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.


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) "te**@test.invalid" }

$_GET:
array(0) { }

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

Actually just what I expected. The problem must be in your server or PHP
configuration.
Nov 22 '05 #2
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.

Nov 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Pedro Fonseca | last post by:
Greetings everyone! I'm porting my applications to PHP5 and I've stumbled on yet another problem. I'll try to simplify things a bit. I have a main script that is being executed (index.php, PHP5...
6
by: Ben | last post by:
Hi everybody! I have a multi-file upload form... Please looks at my code below. It's in an initial stage. I'm trying to display the values of each text box when I press "upload" but it doesn't...
14
by: billy.becker | last post by:
I need to save a wav file that is HTTP POSTed to a php page. What does PHP5 do automatically to a POSTed variable when it puts it in the $_POST superglobal array? I haven't been able to find any...
14
by: Sergei Riaguzov | last post by:
I have a very strange behaviour with POST keys. Consider a test: wtf.html: === Cut === <form action="eh.php" method="POST">     <input type="checkbox" name="many spaces and. . dots. . "/>...
5
by: Aziz | last post by:
Hi, I've recently contacted technical service of a web hosting company and asked them wheter or not they're gonna upgrade to PHP5 and MySQL5. Here's a quote from their response which confused me...
4
by: Chuck Anderson | last post by:
I am trying to install Php5 on my WindowsXP machine (at home, not on the 'net). I downloaded the Php Windows binary at php.net, unzipped it to c:/Php5, changed my Apache config file to use Php5...
6
by: comp.lang.php | last post by:
I have no idea why this is happening and I need someone to explain this to me at the simplest level absolutely possible (pretend I'm a 10-year old and explain it that way, please!) This class...
5
by: comp.lang.php | last post by:
// NEW 11/27/2006: FINALLY, IF YOU ADDED OR DELETED OR DID ANY KIND OF FORM ACTION SUCCESSFULLY, DON'T RE-DISPLAY THE NEW EXPENSE ITEMS VIA $_POST if ($_POST && (!is_array($leaseObj->errorArray)...
17
by: john | last post by:
All: I'm a long-time developer, new to PHP.... Is there an idiom used in PHP to construct SQL statments from $_POST data? I would guess that in many applications, the data read from $_POST...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.