Reply to Re: include("/main.php") won't work on a hosting machine

Your name:

Reply:


Posted by Jerry Stuckle on 06/19/07 10:07

Summercoolness@gmail.com wrote:
> if you are just a users among the 100s of users on a hosting machines,
> then if you do a include("/main.php"); it won't include the file
> but will say
>
> Failed opening required '/main.php' (include_path='.:/usr/local/nf/
> lib/php')
>
> it seems ok to include("../main.php"); except the file will not work
> if moved from www.abc.com/movies to a new location of
> www.abc.com/movies/little-mermaid is there a better solution for
> this?
>

include ($_SERVER['DOCUMENT_ROOT']) . '/main.php');

That way you don't have to worry about include paths, which some hosts
don't allow you to change. It also works on IIS, which doesn't have
..htaccess.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[Back to original 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

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