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]
|