FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » why does $_SERVER['PHP_SELF'] say /test.php/test.php for test.php?
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
why does $_SERVER['PHP_SELF'] say /test.php/test.php for test.php? [message #170027] Wed, 06 October 2010 04:53 Go to next message
yawnmoth is currently offline  yawnmoth
Messages: 5
Registered: September 2010
Karma: 0
Junior Member
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?
Re: why does $_SERVER['PHP_SELF'] say /test.php/test.php for test.php? [message #170028 is a reply to message #170027] Wed, 06 October 2010 07:30 Go to previous messageGo to next message
alvaro.NOSPAMTHANX is currently offline  alvaro.NOSPAMTHANX
Messages: 277
Registered: September 2010
Karma: 0
Senior Member
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
--
Re: why does $_SERVER['PHP_SELF'] say /test.php/test.php for test.php? [message #170029 is a reply to message #170028] Wed, 06 October 2010 08:48 Go to previous messageGo to next message
Willem Bogaerts is currently offline  Willem Bogaerts
Messages: 8
Registered: September 2010
Karma: 0
Junior Member
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/
Re: why does $_SERVER['PHP_SELF'] say /test.php/test.php for test.php? [message #170032 is a reply to message #170027] Wed, 06 October 2010 12:04 Go to previous messageGo to next message
August Karlstrom is currently offline  August Karlstrom
Messages: 16
Registered: October 2010
Karma: 0
Junior Member
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
Re: why does $_SERVER['PHP_SELF'] say /test.php/test.php for test.php? [message #170033 is a reply to message #170029] Wed, 06 October 2010 12:30 Go to previous message
alvaro.NOSPAMTHANX is currently offline  alvaro.NOSPAMTHANX
Messages: 277
Registered: September 2010
Karma: 0
Senior Member
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
--
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: PHP on PIE: framework that combines the best ideas from great PHP projects
Next Topic: search for book "Extending and Embedding PHP" as PDF edition
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 12:34:01 GMT 2024

Total time taken to generate the page: 0.03262 seconds