#32812 [Fbk->Opn]: Post Multipart/formdata, $HTTP_POST_VARS doesn't get initialized correctly!

From: Date: Sun, 24 Apr 2005 20:13:49 +0000
Subject: #32812 [Fbk->Opn]: Post Multipart/formdata, $HTTP_POST_VARS doesn't get initialized correctly!
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-78126@lists.php.net to get a copy of this message
ID: 32812 User updated by: samuel at replicon dot com Reported By: samuel at replicon dot com -Status: Feedback +Status: Open Bug Type: Scripting Engine problem Operating System: Windows 2000 PHP Version: 5.0.4 New Comment: var_dump($HTTP_POST_VARS) --> NULL var_dump($HTTP_POST_FILES) --> NULL Previous Comments: ------------------------------------------------------------------------ [2005-04-24 22:07:44] tony2001@php.net Use var_dump($HTTP_POST_VARS); to see the contents of the variable. Also check $_POST too. ------------------------------------------------------------------------ [2005-04-24 21:58:41] samuel at replicon dot com refine summary. ------------------------------------------------------------------------ [2005-04-24 21:55:30] samuel at replicon dot com Code to reproduce the bug ========================= <?php //if ($HTTP_POST_VARS['submit']) { // this statement doesn't work since $HTTP_POST_VARS is always empty!! if (isset($_POST['submit'])) { // for debugging purpose print_r($_POST); print_r($HTTP_POST_VARS); print_r($HTTP_POST_FILES); if (!is_uploaded_file($HTTP_POST_FILES['file']['tmp_name'])) { $error = "You did not upload a file!"; unlink($HTTP_POST_FILES['file']['tmp_name']); } else { copy($HTTP_POST_FILES['file']['tmp_name'],"/finallocation/".$HTTP_POST_FILES['file']['name']); unlink($HTTP_POST_FILES['file']['tmp_name']); print "File has been successfully uploaded!"; exit; } } ?> <html> <head></head> <body> <form action="<?=$PHP_SELF?>" method="post" enctype="multipart/form-data"> <?=$error?> <br><br> Choose a file to upload:<br> <input type="file" name="file"><br> <input type="submit" name="submit" value="submit"> </form> </body> </html> ------------------------------------------------------------------------ [2005-04-24 21:29:06] samuel at replicon dot com Description: ------------ when post multipart/form-data, $HTTP_POST_VARS doesn't get initialized correctly, actually, it's empty. Expected result: ---------------- $HTTP_POST_VARS should contain post data ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=32812&edit=1

« previous php.bugs (#78126) next »