php.net |  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
Votes:2
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
 [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!

Thanks

David

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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


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

David
 [2002-05-05 16:26 UTC] mfischer@php.net
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.

Thanks

David
 [2002-05-05 16:39 UTC] mfischer@php.net
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. http://www.dgtechnology.com/server.php
Make sure to keep the www..

Thanks

David
 [2002-05-05 17:04 UTC] mfischer@php.net
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] mfischer@php.net
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] imajes@php.net
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!

David
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 01 23:01:28 2024 UTC