Bug #14288 Updated: HTTP_GET_VARS influenced by PHP_SELF
| From: | sniper@php.net | Date: | Wed, 05 Dec 2001 00:41:41 +0000 |
| Subject: | Bug #14288 Updated: HTTP_GET_VARS influenced by PHP_SELF | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-72534@lists.php.net to get a copy of this message | ||
ID: 14288
Updated by: sniper
Reported By: se@brainbits.net
Old Status: Open
Status: Bogus
Bug Type: Variables related
Operating System: SuSE7.2; Apache 1.3.20; mod_php4
PHP Version: 4.0.6
New Comment:
RTFM:
http://www.php.net/manual/en/language.variables.predefined.php
$PHP_SELF only contains filename of the currently executing script,
nothing else.
Ask further support questions on the mailing lists:
http://www.php.net/support.php
--Jani
Previous Comments:
------------------------------------------------------------------------
[2001-12-02 02:51:12] zak@php.net
Cannot reproduce on server (and client ftm) SuSE 7.2 w/
Apache 1.3.22 using Netscape Communicator or Konqueror.
Can you reproduce this behavior under all browsers? What
happens when you use a submit button instead of javascript?
------------------------------------------------------------------------
[2001-11-29 14:00:26] se@brainbits.net
<?php
if($HTTP_GET_VARS["delete"]){
echo "delete";
}else{
echo "don't delete";
}
?>
<html>
<head>
</head>
<body>
<form action="<?php echo $PHP_SELF;?>" method="POST"
name="form1">
<input type="text" name="test">
<a href="javascript:document.form1.submit();">Save</a>
</form>
<a href="<?php echo $PHP_SELF;?>?delete=true">delete</a>
</body>
</html>
The script above don't work correctly. After clicking "delete" the if-statement print
"delete". Then you click on "Save" and the if-statement print "delete"
just like you click on "delete".
If the "echo $PHP_SELF" in the form-tag will be replaced by the plaintext-name of the
script everything will work correctly - you can click on "Save" then and the if-statement
gives you a "don't delete".
It seems like the $PHP_SELF stores the HTTP_GET_VARS, but if I do a "echo $PHP_SELF" I get
the script path, the script name and that's all, there are no HTTP_GET_VARS - but the script
still works like the HTTP_GET_VARS are there.
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=14288&edit=1