Afficher un message
Vieux 01/10/2007, 13h53   #3
artev
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: identify by php the path of the page

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?
  Réponse avec citation
 
Page generated in 0,05031 seconds with 9 queries