php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33741 $_POST superglobal not populated
Submitted: 2005-07-18 07:54 UTC Modified: 2005-07-18 10:24 UTC
From: robbhammack at gmail dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.1.0b2 OS: Win2K sp2
Private report: No CVE-ID: None
 [2005-07-18 07:54 UTC] robbhammack at gmail dot com
Description:
------------
When submitting a html form using the post method, the superglobals $_POST and $_REQUEST are not populated.
The $HTTP_RAW_POST_DATA is.
When submitting using get, the $_GET and $_REQUEST work as expected. I first noticed this in 5.1.0b2 and upgraded to 5.1.0b3 to see if it had been fixed.

OS is win2K xp2
PHP Version 5.1.0b3
System 	Windows NT MINERVA 5.1 build 2600
Build Date 	Jul 14 2005 20:32:24
Configure Command 	cscript /nologo configure.js
"--enable-snapshot-build" "--with-gd=shared"
Server API 	Apache 2.0 Handler
Virtual Directory Support 	enabled
Configuration File (php.ini) Path 	C:/Development/programs/php5/php.ini
PHP API 	20041225
PHP Extension 	20050617
Zend Extension 	220050617

Apache Version 	Apache/2.0.53 (Win32) PHP/5.1.0b3 DAV/2
Apache API Version 	20020903
Loaded Modules 	core mod_win32 mpm_winnt http_core mod_so mod_access
mod_actions mod_alias mod_asis mod_auth mod_autoindex mod_cgi mod_dav
mod_dav_fs mod_dir mod_env mod_imap mod_include mod_info mod_isapi
mod_log_config mod_mime mod_negotiation mod_setenvif mod_userdir
mod_php5

Reproduce code:
---------------
<html>
<head>
</head>
<body>
<?php
print("Request method: " . $_SERVER['REQUEST_METHOD']."<br />");
print("Dump of HTTP RAW POST DATA ". var_dump($HTTP_RAW_POST_DATA)."<br />");
print("Dump of POST Data" . var_dump($_POST)."<br />");
print("Dump of REQUEST Data" . var_dump($_REQUEST)."<br />");
?>
<form method="POST" action="login.php?action=login"  enctype="text/plain">
  <input type="text" size="40" name="username" id="username"></input><br />
  <input type="text" size="40" name="passwd" id="passwd"></input><br />
  <input type="submit" name="submit" id="submit" value="Login"></input>
</form>  
</body>  
</form>

Expected result:
----------------
I expect the var_dump($_POST)and var_dump($_REQUEST) to output the values from the form elements. I verified that the form was using the post method two ways: liveHTTPHeaders and $_SERVER['REQUEST_METHOD']

Actual result:
--------------
URL: http://projectmanager/login.php?action=login
Results:

Request method: POST
string(42) "username=Robb passwd=Robb submit=Login " Dump of HTTP RAW POST DATA
array(0) { } Dump of POST Data
array(1) { ["action"]=> string(5) "login" } Dump of REQUEST Data

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-07-18 10:24 UTC] sniper@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

Valid values for enctype in <form> tag are:

application/x-www-form-urlencoded
multipart/form-data

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 23:01:29 2024 UTC