f



why does $_SERVER['PHP_SELF'] say /test.php/test.php for test.php?

I have a PHP script at 127.0.0.1/test.php.  It's contents are as
follows:

<?php
echo $_SERVER['PHP_SELF'];
?>

And it's output isn't test.php, as I'd expect, or /test.php, but
rather, /test.php/test.php.  Why?  And how do I fix it?
0
terra1024 (490)
10/6/2010 4:53:16 AM
comp.lang.php 32646 articles. 0 followers. Post Follow

4 Replies
2722 Views

Similar Articles

[PageSpeed] 58

El 06/10/2010 6:53, yawnmoth escribi�/wrote:
> I have a PHP script at 127.0.0.1/test.php.  It's contents are as
> follows:
>
> <?php
> echo $_SERVER['PHP_SELF'];
> ?>
>
> And it's output isn't test.php, as I'd expect, or /test.php, but
> rather, /test.php/test.php.  Why?  And how do I fix it?

What output do you get if you change it to this?

<?php
echo '[' . $_SERVER['PHP_SELF'] . ']';
?>

What do your other $_SERVER values look like?

<?php
print_r($_SERVER);
?>

-- 
-- http://alvaro.es - �lvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programaci�n web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--
0
10/6/2010 7:30:28 AM
On 06/10/10 09:30, "�lvaro G. Vicario" wrote:
> El 06/10/2010 6:53, yawnmoth escribi�/wrote:
>> I have a PHP script at 127.0.0.1/test.php.  It's contents are as
>> follows:
>>
>> <?php
>> echo $_SERVER['PHP_SELF'];
>> ?>
>>
>> And it's output isn't test.php, as I'd expect, or /test.php, but
>> rather, /test.php/test.php.  Why?  And how do I fix it?
> 
> What output do you get if you change it to this?
> 
> <?php
> echo '[' . $_SERVER['PHP_SELF'] . ']';
> ?>
> 
> What do your other $_SERVER values look like?
> 
> <?php
> print_r($_SERVER);
> ?>
> 

Probably the same. It's a known bug.

Best regards,
-- 
Willem Bogaerts

Application smith
Kratz B.V.
http://www.kratz.nl/
0
10/6/2010 8:48:56 AM
On 2010-10-06 06:53, yawnmoth wrote:
> I have a PHP script at 127.0.0.1/test.php.  It's contents are as
> follows:
>
> <?php
> echo $_SERVER['PHP_SELF'];
> ?>
>
> And it's output isn't test.php, as I'd expect, or /test.php, but
> rather, /test.php/test.php.  Why?  And how do I fix it?

Seems like a bug. What's your platform?


/August

-- 
The competent programmer is fully aware of the limited size of his own 
skull. He therefore approaches his task with full humility, and avoids 
clever tricks like the plague. --Edsger Dijkstra
0
fusionfile (195)
10/6/2010 12:04:03 PM
El 06/10/2010 10:48, Willem Bogaerts escribi�/wrote:
> On 06/10/10 09:30, "�lvaro G. Vicario" wrote:
>> El 06/10/2010 6:53, yawnmoth escribi�/wrote:
>>> I have a PHP script at 127.0.0.1/test.php.  It's contents are as
>>> follows:
>>>
>>> <?php
>>> echo $_SERVER['PHP_SELF'];
>>> ?>
>>>
>>> And it's output isn't test.php, as I'd expect, or /test.php, but
>>> rather, /test.php/test.php.  Why?  And how do I fix it?
>>
>> What output do you get if you change it to this?
>>
>> <?php
>> echo '[' . $_SERVER['PHP_SELF'] . ']';
>> ?>
>>
>> What do your other $_SERVER values look like?
>>
>> <?php
>> print_r($_SERVER);
>> ?>
>>
>
> Probably the same. It's a known bug.

Ah, yep:

http://bugs.php.net/bug.php?id=49825



-- 
-- http://alvaro.es - �lvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programaci�n web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--
0
10/6/2010 12:30:35 PM
Reply: