You are here: Re: __SELF__? « PHP Programming Language « IT news, forums, messages
Re: __SELF__?

Posted by Toby Inkster on 11/19/53 11:47

Alan Little wrote:

> 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.

A PHP script *can never _know_* what URL it was requested at. (Nor can a
Perl script, nor any other scripting language.)

For example:

http://server2.example.org/foo.php contains the following:

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

http://server1.example.org/.htaccess contains the following:

RewriteEngine on
RewriteRule ^(.*)\.php$ http://server2.example.org/foo.php

Now I visit "http://server1.example.org/bar.php", the script will echo
back to me "foo.php".

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

 

Navigation:

[Reply to this 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

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