You are here: __FILE__ and sym-links « PHP Programming Language « IT news, forums, messages
__FILE__ and sym-links

Posted by BKDotCom on 11/21/07 22:56

I have a problem I can't crack.

I have the following example directory structure
/some_arbitrary_path/htdocs/ ( also $_SERVER['DOCUMENT_ROOT'] )
/some_arbitrary_path/htdocs/common is a symbolic link to
/some_different_path/common/

if $_SERVER['DOCUMENT_ROOT'].'/common/some_script.php' gets
included...
it works just fine, however, within some_script.php
__FILE__ == /some_different_path/common/some_script.php

So:
How do I determine that __FILE__ does in fact fall inside the
DOCUMENT_ROOT tree?
and/or, get a the value of the path that I included (one with /
arbitrary_path)
and/or, determine the "html path" to some_script.php is '/common/
some_script.php'?

 

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

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