|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17021 PHP_SELF Displays nothing
Submitted: 2002-05-05 15:54 UTC Modified: 2002-05-06 09:04 UTC
Avg. Score:4.5 ± 0.5
Reproduced:0 of 2 (0.0%)
From: dgtech at riverview dot net Assigned:
Status: Closed Package: Other web server
PHP Version: 4.2.0 OS: Windows XP Pro
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: dgtech at riverview dot net
New email:
PHP Version: OS:


 [2002-05-05 15:54 UTC] dgtech at riverview dot net
I am on an Xitami Server V2.4d9 running Windows XP PRO  with PHP Version 4.20. I am a script called PHPAdsNew and it uses the <?php echo basename($PHP_SELF);?> PHP command to get the name of the file so, it can submit forms.

Example: <form action="<?php echo basename($PHP_SELF);?>">

But, it will not work.. It stays EMPTY. PHP will not write the name of the file. 

It would be way to hard to change the script around with over 80 files, no way!




Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-05-05 16:06 UTC]
In PHP 4.2.0, the 'register_globals' setting default changed to
be off. See for more info.

 [2002-05-05 16:12 UTC] dgtech at riverview dot net
No, I set it so, register_globals is on.

 [2002-05-05 16:26 UTC]
What's the output of $PHP_SELF ?
 [2002-05-05 16:31 UTC] dgtech at riverview dot net
NOTHING. It doesn't output anything. Stays blank, on a Redhat Linux, using Apache 1.3 it works. It displays PHP_SELF.


 [2002-05-05 16:39 UTC]
No, echo $PHP_SELF or var_dump(${PHP_SELF) *cannot* display PHP_SELF unless you disabled php parsing or whatever.

Anyway, what does phpinfo() output say about PHP_SELF, does it show anywhere up in the page? If so, where (paste the appropriate table line) ?

And, also double check the register_globals ini setting in your phpinfo() output. I still think you have it disabled.
 [2002-05-05 16:52 UTC] dgtech at riverview dot net
The script doesn't show anything. Just says "_SERVER["PHP_SELF"]" in the first column and nothing in the second column.

See for your self.
Make sure to keep the www..


 [2002-05-05 17:04 UTC]
Changing category.

Seems to be a Xitami or CGI issue then (sorry I seem to have misread you were using Xitami).
 [2002-05-05 17:19 UTC]
Upon closer inspectation of the CGI code I it seems your webserver doesn't properly set the environment varaibles needed for PHP to construct the PHP_SELF variable.

CGI needs to have either PATH_INFO or SCRIPT_NAME to be set via the environment. That's the only possibility why PHP_SELF is simply empty.

Since I'm not that familiar with Xitami I can't say if it's a bug there, but you might want to check in Xitami related forums to get a quicker answer.
 [2002-05-05 21:15 UTC]
quite frankly, xitami gives extremely strange results, for lots of issues. 

have you considered using another server, such as apache for windows?
 [2002-05-06 09:04 UTC] dgtech at riverview dot net
I have decided to Switch to Apache. If I have further problems I will open a new bug report.

Thank you for you time!

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Jul 19 11:01:30 2024 UTC