Re: $_POST superglobal empty, while readfile("php://input")does return data.

From: Date: Sun, 04 Nov 2007 09:43:12 +0000
Subject: Re: $_POST superglobal empty, while readfile("php://input")does return data.
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-264022@lists.php.net to get a copy of this message
Jim Lucas schreef:
Mackatack wrote:
Nathan Nobbe schreef:
On 11/3/07, Mackatack <mackatack@gmail.com> wrote:
Hey all! Im trying to submit a very basic form to phpinfo(): <form action='?' method='POST'>
        <input type='hidden' name='foo' value='bar' />
        <input type='submit' />
</form> <?php
        error_reporting(E_ALL);
        echo 'var_dump: ';
        var_dump($_POST);
        echo '<br>readfile: ';
        readfile("php://input")
        phpinfo();
?> When i use the button to submit the form and it loads the new page I get: var_dump: array(0) { } readfile: foo=bar I would expect the $_POST var to be filled cause the readfile does work. Also, get requests, cookies and sessions do work... all cept for the POST data. I couldn't find any errors in the apache error_log. I think it's not browser related because I tested it another server and it did work using FF and IE7. Im using PHP Version 5.2.4_p20070914-pl2-gentoo, with suhosin and the ZendOptimizer on Linux AMD64. I've also set the max_post and max_upload to 1024M for testing... Nothing works... :( Does anyone have a direction for me? Been using php for years but have never seen anything like this...
is this a new box? have you tried w/o suhosin and / or zend optimizer? did the other box you tested on have suhosin? -nathan
Yes, this is a new box, but i did try without suhosin and the ZendOptimizer. No dice. -Mackatack
What about checking to see if Apache has the the POST option disabled. Make sure the apache is allowing posts to the domain/directory/file/etc...
I have not defined any <limit> tags in my httpd.conf and by default apache should accept all request methods. I've stripped my apache config down to: Listen 80 NameVirtualHost *:80 <VirtualHost *:80>
        ServerName my.server.com
        DocumentRoot "/var/www/
        <Directory "/var/www/">
                AllowOverride All
                Order allow,deny
                Allow from all
        </Directory>
</VirtualHost> Also, im guessing it's not apache related because the readfile() function does return the form data. Any other thoughts? -Mackatack

« previous php.general (#264022) next »