Page 1 of 1

File include

Posted: Fri Feb 04, 2011 2:29 am
by pustinia
Hi coders
Myy host upgraded it’s server from PHP 5.2.0 to PHP 5.2.6. and I use <?php include("inc/menu.php");?> to include php files in website.
It works well in my local server but when I upload it to the live server it does not work at all, help.

Re: File include

Posted: Fri Feb 04, 2011 3:31 am
by greyhoundcode
I wouldn't think this is anything to do with the PHP upgrade. I think you might need to double-check that filepath.

Re: File include

Posted: Fri Feb 04, 2011 3:39 am
by pustinia
The file path is correct, i even tried putting the full url path but no luck. :D ..
If it was a path i was gonna get an error in the site..

Re: File include

Posted: Fri Feb 04, 2011 9:08 am
by greyhoundcode
pustinia wrote:If it was a path i was gonna get an error in the site..
That depends on your error reporting level of course. Can you confirm what that is? Can you also confirm if other PHP scripts are executing as expected? What is the result if you substitute the following in place of your include code:

Code: Select all

if (file_exists($path))
    echo 'The file does exist';
else
    echo 'My file path is wrong';

Re: File include

Posted: Mon Feb 07, 2011 1:50 am
by pustinia
Thanks greyhoundcode i will implement...

Re: File include

Posted: Mon Feb 07, 2011 2:35 am
by pustinia
I have found the problem. It has to do with the hosting company and their stupid servers... :D