Jump to content

Recommended Posts

Hello :)

 

I have a problem and I think it is very easy to be solved!!

 

In my index.php I have footer.php

 

1. when index.php and footer.php are in the same folder, everything is OK

2. when index.php is inside the root folder and footer.php is inside the folder PHP_Files

I put in index.php:

include "PHP_Files/footer.php"; also everything is fine, but the big problem is:

 

when index.php is inside the folder fathers for example and footer.php is inside the folder PHP_Files

 

I receive this error:

 

Warning: include(PHP_Files/footer.php) [function.include]: failed to open stream: No such file or directory in C:\www\arabic\SubPage\Fathers\index.php on line 27

 

Warning: include() [function.include]: Failed opening 'PHP_Files/footer.php' for inclusion (include_path='.;C:\php5\pear') in C:\www\arabic\SubPage\Fathers\index.php on line 27

 

 

The problem is that include can not be identified if the footer.php is not in the same line in folders, it is backward, and index.php is inside a folder...

 

Can U help plzz!!!

 

This is what I put in index.php:

 

include ('arabic/SubPage/PHP_Files/footer.php');

the index.php that I heve a problem in it is my subdomain coz I have another index.php that is before the folder arabic.

 

 

Warning: include(arabic/SubPage/PHP_Files/footer.php) [function.include]: failed to open stream: No such file or directory in C:\www\arabic\SubPage\Fathers\index.php on line 27

 

Warning: include() [function.include]: Failed opening 'arabic/SubPage/PHP_Files/footer.php' for inclusion (include_path='.;C:\php5\pear') in C:\www\arabic\SubPage\Fathers\index.php on line 27

 

 

 

 

This is what I put in index.php:

 

include ('arabic/SubPage/PHP_Files/footer.php');

the index.php that I heve a problem in it is my subdomain coz I have another index.php that is before the folder arabic.

 

 

Warning: include(arabic/SubPage/PHP_Files/footer.php) [function.include]: failed to open stream: No such file or directory in C:\www\arabic\SubPage\Fathers\index.php on line 27

 

Warning: include() [function.include]: Failed opening 'arabic/SubPage/PHP_Files/footer.php' for inclusion (include_path='.;C:\php5\pear') in C:\www\arabic\SubPage\Fathers\index.php on line 27

 

 

 

 

 

Put EXACTLY what I wrote.  O_O

include ('../PHP_Files/footer.php');

 

That line will work, just copy and paste it in. =/

DarkWater: include(), include_once() etc.. are PHP statements, not functions. (Not a language construct) but, yes they do not require the parentheses.

 

I know they're not functions, and they ARE language constructs.  Language constructs are different from functions.

 

include()

 

Go down to RIGHT above the comments:

    Note: Because this is a language construct and not a function, it cannot be called using variable functions

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.