php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27019 PHP_SELF blank and does not appear to run.
Submitted: 2004-01-23 08:58 UTC Modified: 2004-01-23 09:45 UTC
From: eadwint at fastmail dot fm Assigned:
Status: Not a bug Package: Variables related
PHP Version: 4.3.5RC1 OS: Win2K
Private report: No CVE-ID: None
 [2004-01-23 08:58 UTC] eadwint at fastmail dot fm
Description:
------------
PHP_SELF is doesn't seen to be visible in view source



When I press submit it doesn't seem to do anything! I looked into it on the php site and found a bug (Bug #21261 and 4060 http://bugs.php.net/bug.php?id=21261). I then downloaded and installed the latest php snapshot (4.3.5RC1)but the problem persists. As a person fairly new to development I'm a bit stumped, have you any suggestions?

The closure details of 4060 "Fixed by Frank in CVS" are insufficient for me to know what to do next.

Reproduce code:
---------------
<html>

<body>

<?php



if ($submit) {

  // process form

  while (list($name, $value) = each($HTTP_POST_VARS)) {

    echo "$name = $value<br>\n";

  }

} else{

  // display form

  ?>

  <form method="post" action="<?php echo $PHP_SELF?>">

  First name:<input type="Text" name="first"><br>

  Last name:<input type="Text" name="last"><br>

  Address:<input type="Text" name="address"><br>

  Position:<input type="Text" name="position"><br>

  <input type="Submit" name="submit" value="Enter information">

  </form>

  <?php



} // end if



?>



</body>



</html>


Appears as follows when I view source:

<html>

<body>


  <form method="post" action="">

  First name:<input type="Text" name="first"><br>

  Last name:<input type="Text" name="last"><br>

  Address:<input type="Text" name="address"><br>

  Position:<input type="Text" name="position"><br>

  <input type="Submit" name="submit" value="Enter information">

  </form>

  


</body>



</html>


Expected result:
----------------
A display of the variables placed in the form displayed on screen when submit button is pressed.

Actual result:
--------------
The form resets itself and data entered is lost.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-01-23 09:09 UTC] eadwint at fastmail dot fm
The latest snapshot i've loaded is 4.3.5RC2

I am fairly confident I've missed something but I would really like some guidance.
 [2004-01-23 09:22 UTC] eadwint at fastmail dot fm
Found a fix....

register_globals is set to off in later versions....by default.
 [2004-01-23 09:22 UTC] eadwint at fastmail dot fm
Found a fix....

register_globals is set to off in later versions....by default.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 01 01:01:35 2024 UTC