From:             jnavratil at houston dot rr dot com
Operating system: SuSE Linux 9.1
PHP version:      5CVS-2005-03-19 (dev)
PHP Bug Type:     CGI related
Bug description:  $_POST, $HTTP_RAW_POST_DATA not set

Description:
------------
This bug is similar to, but not quite the same as bug #31417.

Running Suse Linux 9.1, Apache 2.0.53 and latest snapshot of PHP, I do not
have $_POST variables being set.  $_GET superglobal seems to be fine. 
Additionally, even though phpinfo() shows 'always_populate_raw_post_data'
on, $HTTP_RAW_POST_DATA is not defined.

PHP configure line is:

./configure --prefix=/usr/local/php5 \
       --with-apxs2=/usr/local/apache2/bin/apxs \
       --with-libxml-dir=/usr/local/lib --with-zlib \
       --with-zlib-dir=/usr/local/lib \
       --with-mysql=/usr \
       --with-gd \
         --with-jpeg-dir=/usr/lib --with-png-dir=/usr/lib \
         --enable-gd-native-ttf --with-freetype-dir=/usr/lib \
       --enable-soap --enable-sockets \
       --with-jpeg-dir=/usr --enable-exif


Reproduce code:
---------------
<html>
  <body>
<?php
echo '<!-- $_POST:'.print_r($_POST, TRUE)." -->\n";
echo '<!-- $_GET:'.print_r($_GET, TRUE)." -->\n";
echo '<!-- $_REQUEST:'.print_r($_REQUEST, TRUE)." -->\n";
// Next line generates 'Undefined variable: HTTP_RAW_POST_DATA'
// even though phpinfo shows always_populate_raw_post_data On
// echo '<!-- raw post data:'.$HTTP_RAW_POST_DATA." -->\n";
if (!isset($_POST['tableName']) or trim($_POST['tableName']) == '') {
?>
    <form method="post" action="post.php">
      <p> Table Name:&nbsp;<input type="text" name="tableName" /> </p>
      <input type="submit" value="Submit" />
    </form>
<?php } else { ?>
    <p> You entered <?php echo $_POST['tableName']; ?> </p>
<?php } ?>
  </body>
</html>

Expected result:
----------------
I expect the code to present a form to input a string, then display the
string when the form is submitted.  I expect to see comments in the page
source displaying the $_POST, $_GET and $_REQUEST arrays.

Actual result:
--------------
The $_POST variables are not set when the form is submitted.  If I attach
variables to the URL (i.e. post.php?key=value), I see variables in the
$_GET and $_REQUEST superglobals.  Comments generated in the page source
indicate that $_POST is an array, but it is empty.

-- 
Edit bug report at http://bugs.php.net/?id=32375&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=32375&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=32375&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=32375&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=32375&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=32375&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=32375&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=32375&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=32375&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=32375&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=32375&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=32375&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=32375&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=32375&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=32375&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=32375&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=32375&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=32375&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=32375&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=32375&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=32375&r=mysqlcfg

Reply via email to