Originally posted by danielson2k
well for example, the following isnt working:
if(is_file('pages/'.$_GET['page'].'.php')){
include('pages/'.$_GET['page'].'.php');
} else {
include('pages/home.php');
}
[/COLOR]
i dont quite understand linux file management... [/B]
It's really not that much different from Windows. The issue here is your file path needs to be absolute. So if your file is in /pages/ under your web's document root directory, you need to preceed that with the full path.
example:
my document root is htdocs.
htdocs is located under /server/user/
I have a directory called pages under htdocs. the absolute path to any file in that directory is:
/server/user/htdocs/pages/file.html
you have to remeber that the web server is calling php which is probably loacated in /bin/php or something like that. php needs the absolute path to the file.
Try doing this:
$_SERVER['DOCUMENT_ROOT'] . "/pages/file.html"
If the script that is looking for the file is in the same directory as pages/ then you could use ./pages/file.html but I don't think it will work.
Hope this helps,
- Keith