|  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
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
Have you experienced this issue?
Rate the importance of this bug to you:

 [2004-08-29 11:49 UTC] r dot wilczek at web-appz dot de
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 --]">

<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" 
        value="[-- ACTION --]">
 <input type="submit" 
        value="[-- COMMENT --]">

Expected result:
<form method="post" 
      action=""><input type="hidden" name="PHPSESSID" value="6745135150906f4748b27d0cbe43d99a" />
 <input type="hidden" 
 <input type="submit" 
        value="Just do it!">

Actual result:
<form method="post" 
 <input type="hidden" 
 <input type="submit" 
        value="Just do it!">


Add a Patch

Pull Requests

Add a Pull Request


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 Mar 02 01:01:28 2024 UTC