php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #13606 $PHP_SELF not always point to script name
Submitted: 2001-10-08 23:55 UTC Modified: 2002-02-06 12:23 UTC
From: flaviovs at magnux dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.0.6 OS: Linux+Apache 1.3.20+PHP (DSO)
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: flaviovs at magnux dot com
New email:
PHP Version: OS:

 

 [2001-10-08 23:55 UTC] flaviovs at magnux dot com
The docs says that $PHP_SELF contains "The filename of the currently executing script, relative to the document root." However, if one uses additional PATH_INFO data in the URL, they get inserted on $PHP_SELF as well.

Example script: <?= $PHP_SELF ?>

http://example.org/example.php
	prints "/example.php"

http://example.org/example.php/foobar.html
	prints "/example.php/foobar.html"

If this is not a bug in PHP then the docs may need to be updated.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-12-14 13:49 UTC] yohgaki@php.net
Type = Documentation Problem.

When test.php is a script, $PHP_SELF === /test.php/some_string
http://example.com/test.php/some_string

Document should descript this behavior..

 [2002-02-06 12:23 UTC] alindeman@php.net
Fixed in docs, will appear in a day or two...

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Mar 03 23:01:30 2025 UTC