php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32232 Bug with CGI HTTP_POST_VARS
Submitted: 2005-03-08 15:02 UTC Modified: 2005-03-29 00:37 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: crandym2003 at yahoo dot com Assigned:
Status: Not a bug Package: CGI/CLI related
PHP Version: 4.3.10 OS: Windows/Unix
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: crandym2003 at yahoo dot com
New email:
PHP Version: OS:

 

 [2005-03-08 15:02 UTC] crandym2003 at yahoo dot com
Description:
------------
When using the POST method in a form defined with enctype="multipart/form-data", a single defined hidden form element is lost between form named EditSeries when submit button posts form to submit_series.php.  This only happens when text data entered into the TEXTAREA contains a special trademark character &#8482.  I have seen this same bug before with other special characters.

The form "submit_series.php" should get (4) form elements in the attached code which are: series_id, destination, series_desc, series_photo.  Performing a dump_var $HTTP_SERVER_VAR at the beginnging of submit_series.php only shows (3) because the first form item "series_id" is somehow lost through CGI intrepretation.  This doesn't happen unless data containing &#8482 is entered into the TEXTAREA box.

The workaround is to place all hidden entities in the form after the TEXTAREA item or insert a extra hidden blank entity just above the series_id entity.

This also does not happen if the enctype="multipart/form-data" is set to text entry only.  In this case however, the form contains an input type=file so the multipart/form-data is necessary.

Reproduce code:
---------------
<form name=EditSeries action="submit_series.php" method="post" enctype="multipart/form-data">

<input type="hidden" name="series_id" value="123">

<input type="hidden" name="destination" value="$HTTP_SERVER_VARS['HTTP_REFERER']">

<TD width="85%"><TEXTAREA  class=FormAdmin name=series_desc rows=8 wrap=virtual cols=66><?php print $series_desc ?></TEXTAREA></TD>

<TD width="85%"><input class=FormAdmin type="file" size="56" name="series_photo" value=""></TD>





Expected result:
----------------
When you run dump_vars($HTTP_SERVER_VARS) on the submit_series.php form and print them, there should be a total of (4) form items passed which are which are: series_id, destination, series_desc, series_photo.

Actual result:
--------------
When you run dump_vars($HTTP_SERVER_VARS) on the submit_series.php form and print them, there area a total of (3) form items passed which are which are: destination, series_desc, series_photo.

Somehow, the first defined hidden entity series_id is lost and not defined in $HTTP_SERVER_VARS.  This only happens when a special trademark character is entered as text data in the TEXTAREA box.

If you move the location of the hidden items somewhere in the form "after" the TEXTAREA item, all elements are forwarded to the next page (i.e., this is a workaround)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-08 23:23 UTC] sniper@php.net
I can not reproduce this. With what browser(s) do you get this? Can you anyhow provide a short but COMPLETE script?
(the one above does not have even a submit button, not to mention the fact that it's not even close being valid HTML)

 [2005-03-08 23:29 UTC] sniper@php.net
And FYI: I'd be very worried if "series_photo" ended up in $HTTP_POST_VARS (or $_POST, which you should use too)

Uploaded file information usually goes into $_FILES..

 [2005-03-20 18:14 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 [2005-03-29 00:37 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.

..

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 17:01:29 2024 UTC