# PHP Include problems (Server?)

**URL:** <https://forum.kirupa.com/t/php-include-problems-server/190496>\
**Category:** programming\
**Created:** [June 12, 2006, 11:19am UTC](https://forum.kirupa.com/t/php-include-problems-server/190496 "2006-06-12T11:19:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![delirious\_andy](https://avatars.discourse-cdn.com/v4/letter/d/e68b1a/32.png) [@delirious\_andy](https://forum.kirupa.com/u/delirious_andy)\
**Post date:** [June 12, 2006, 11:19am UTC](https://forum.kirupa.com/t/php-include-problems-server/190496/1 "2006-06-12T11:19:29Z")

</div>

Hi,

I am having a problem getting a simple PHP Include function to work.

The code I have used is as follows:

\<?  
$ext = “.php”;  
$id = “”.$id."".$ext."";  
if (file\_exists($id))  
{  
include($id);  
} else {  
include “loaded.php”;  
}  
?\>

I am almost certain it has to be something to do with the server as I have tested it and use it on my personal site on which it works perfectly.

My webspace: [http://pub.4ndy.co.uk/PHP\_Test](http://pub.4ndy.co.uk/PHP_Test)

Where it needs to work: [http://www.hi-res-av.com/PHP\_Test](http://www.hi-res-av.com/PHP_Test)

Is there a reason that this function would not work, like an old version of PHP being used on the server or something? The hosting provider said that he could see no fault with the installation at his end.

Any help would be much appreciated as if this doesn’t work I’ll have to revert to having an individual page for each product. 😟 nightmare!
