Reply to Re: __SELF__?

Your name:

Reply:


Posted by Jerry Stuckle on 05/11/06 15:41

Alan Little wrote:
> Carved in mystic runes upon the very living rock, the last words of
> Jerry Stuckle of comp.lang.php make plain:
>
>
>>Alan Little wrote:
>>
>>>I love the __FILE__ constant; it's been enormously useful. Is there a
>>>constant that would be the equivalent of $PHP_SELF? That's also a
>>>useful value, but according to the docs, "...may or may not [exist]
>>>in $_SERVER." In a distributed app, may or may not doesn't fly. I'm
>>>surprised, if there isn't a reliable way to retrieve this value.
>>>
>>
>>If it's supplied by the web server, it's available. But PHP cannot
>>guarantee what the servers give PHP.
>>
>>__FILE__, OTOH, is under complete control of PHP, so PHP can guarantee
>>its existence.
>
>
> I understand; that's what I like about __FILE__. I was wondering if there
> were a similar constant with the same value as $PHP_SELF.
>

Not that's guaranteed to be provided by every host. $_SERVER['PHP_SELF'] (the
real name - it's a member of the $_SERVER array) is good because it's always the
name of the page being displayed. That has to be gotten from the server.

But I wouldn't worry about it. It's available in Apache and IIS. Those account
for > 99% of the servers on the web.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация