You are here: Re: recognize url where file is « PHP Language « IT news, forums, messages
Re: recognize url where file is

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]


Удаленная работа для программистов  •  Как заработать на 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

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