php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29880 trans-sid randomly not added to forms
Submitted: 2004-08-29 11:49 UTC Modified: 2005-02-19 01:00 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: r dot wilczek at web-appz dot de Assigned:
Status: No Feedback Package: Session related
PHP Version: 5.0.0 OS: Windows XP Prof.
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: r dot wilczek at web-appz dot de
New email:
PHP Version: OS:

 

 [2004-08-29 11:49 UTC] r dot wilczek at web-appz dot de
Description:
------------
Sometimes I encounter the strange behaviour that PHP does not add an 
<input type="hidden" name="PHPSESSID" value="6745etcetc" />
in forms having additional whitespaces in the <form>-tag.

I like to have forms readable and often write them like shown in tmplt_button_form.php below.

Sometimes it works; sometimes I have to strip all additional whitespaces from the opening <form>-tag to make PHP rewriting the HTML-output. 
Switching output-buffering on and off did not change the effect. Had the same phenomenon in PHP 4 before.

So my workaround for now is not to write
<form method="post" 
      action="[-- URL --]">

but 
<form method="post" action="[-- URL --]">

- Roland

Reproduce code:
---------------
// The method ...
function HTMLButton($url, $action, $comment)
{
    $file  = 'templates/tmplt_button_form.php';
    $tmplt = implode('', file($file));
    $replace = array(
           '[-- URL --]'     => htmlentities($url),
           '[-- ACTION --]'  => htmlentities($action),
           '[-- COMMENT --]' => htmlentities($comment)
    );
    echo strtr($tmplt, $replace);
}

-- The file tmplt_button_form.php: --

<form method="post" 
      action="[-- URL --]">
 <input type="hidden" 
        name="myaction" 
        value="[-- ACTION --]">
 <input type="submit" 
        value="[-- COMMENT --]">
</form>

Expected result:
----------------
<form method="post" 
      action="http://www.default.com"><input type="hidden" name="PHPSESSID" value="6745135150906f4748b27d0cbe43d99a" />
 <input type="hidden" 
        name="myaction" 
        value="someAction">
 <input type="submit" 
        value="Just do it!">
</form>

Actual result:
--------------
<form method="post" 
      action="http://www.default.com">
 <input type="hidden" 
        name="myaction" 
        value="someAction">
 <input type="submit" 
        value="Just do it!">
</form>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-02-19 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 14:01:32 2024 UTC