Posted by artev on 10/01/07 12:53
not physical path but url:
I explained better my problem (localhost in production will be NAMESITE)
If I am in http://localhost/A/test.php
I want in php a code (or function) that print:
http://localhost/A/
so it recognize automatically the url
I tested functions:
HTTP_HOST but print only localhost
SERVER_NAME but print only localhost
PHP_SELF not print all and insert also file's name (I not want)
/A/test.php
dirname($HTTP_SERVER_VARS['PHP_SELF']); not print all /A
I can write so (semplified the merge):
http:// + SERVER_NAME + dirname PHP_SELF
but remain problems that I must know when I am in https so I can change
the first part http in https;
and is better use SERVER_NAME or HTTP_HOST for recognize SITE (localhost)
is there a function that to do all?
Navigation:
[Reply to this message]
|