You are here: executed script URL « PHP « IT news, forums, messages
executed script URL

Posted by News on 10/05/20 11:12

I'm firt time here so hello everybody

I have some skill in php coding so don't worry, I will no boring
with stupid question.

Due to I'm unable to test my app on all http servers with all configs
I need to know is it possible to get from PHP engine information about
executed script URL (not file system path).

Now what I'm investigated

It's began since I cannot use relative path for Location header on IIS servers. It must
contains URI.

I cannot build the URL with $_SERVER['PHP_SELF'] because it not always
returns relative to server path (due to server configuration it
sometimes returns full URL)

building URL using method described in documentation comments:
$_SERVER['SERVER_NAME'] + $_SERVER['SCRIPT_NAME'] is good until the
system is started with embeded php. If php runs as cgi,
$_SERVER['SCRIPT_NAME'] returns path co cgi.exe

$_SERVER['SCRIPT_FILENAME'] and $_SERVER['PATH_TRANSLATED'] are
filesystem based variables, and are useless because we still have no
information about URL path related to server base URL.

So, is it possible to get this URL automaticly, or I will have add
variable with fixed URL into config file of system I'm working on.


best regards
--
*** Media-IT Michał Kożusznik ***
*** IT networks - databases - multimedia ***
*** maxym@media-it.net ***
*** http://www.media-it.net ***

 

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

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