php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #61303 $_SERVER['PHP_SELF'] description
Submitted: 2012-03-06 18:17 UTC Modified: 2013-12-18 21:38 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: pl1 at liscovius dot de Assigned: philstu (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2012-03-06 18:17 UTC] pl1 at liscovius dot de
Description:
------------
---
From manual page: http://www.php.net/reserved.variables.server#refsect1-reserved.variables.server-indices
---

The description of $_SERVER['PHP_SELF'] is ambiguous and differs too between english and german documentation.

In the example is an url given, but it is a quite bad example.
Is the called script test.php?
Or is the script foo.bar, as the reader must assume when reading the current description ? (which wouldn't normally call the PHP interpreter.., unless someone tweaked server/htaccess configuration especially for this example)

I did my own similiar test and I got 'test.php' with http requests, regardless what i append in the url /test.php , /test.php/bla, or /test.php?bla=1

and i got no

/test.php/bla 
(english documentation)
or 
/test.php/bla/
(as in german php documentation)



Patches

server.xml.patch (last revision 2013-05-06 23:37 UTC by pete at petermcdonald dot co dot uk)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-05-03 01:40 UTC] pete at petermcdonald dot co dot uk
Agreed the example should be something more along the lines of

$_SERVER['PHP_SELF'] in a script at the address http://example.com/somedir/foo.php 
would be /somedir/foo.php. The __FILE__ constant contains the full path and 
filename of the current (i.e. included) file.
 [2013-12-18 21:38 UTC] philstu@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: philstu
 [2013-12-18 21:38 UTC] philstu@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 [2020-02-07 06:08 UTC] phpdocbot@php.net
Automatic comment on behalf of philstu
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=b2ae70c4949c47eb05b1de06da67010bb72073d6
Log: Fixed bug #61303 - $_SERVER['PHP_SELF'] description
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jun 12 11:01:35 2024 UTC