Jump to content

Directry help


_simon_

Recommended Posts

I have coded my website in HTML, CSS and PHP.

 

I have a navigation menu then a sub headings menu

 

EXAMPLE:

 

Navigation menu says:  'BOOKS' once clicked you get a page with a  list of sub headers with book names 'THE MAN IN THE WHITE SUIT' and so on

 

all parts of my main website is in

 

dir/my_site/.....

 

what i want to do is make a directory for the links to put the sub headings in

 

example

 

dir/my_site/books/.........

 

I have put my navigation links in one file so that i can edit them in one file and it changes on all the web pages automatically. i link to the navigation page using the below code on each page.

 

<?php include("my_site/navigation.php"); ?>

 

Anyway, when i create a new directory called 'BOOKS' and put the file.php in there i get php errors.  and the only way i can seen to over come the errors is by removing all the php i have used in the file, but then i can not include /dir/my_site/navigation.php in the page because i have removed the php code.

 

 

Warning: include(my_site/navigation.php) [function.include]: failed to open stream: No such file or directory in /opt/lampp/htdocs/my_site/books/file.php on line 30

 

LINE 30 is :    <?php include("my_site/navigation.php"); ?>

 

and that code works on all other pages apart from the page that is in dir/my_site/books/file.php

 

and it also does not connect to my CSS page  ether.

 

all the files in dir/my_site/.... work fine and connect to all other files

 

but the file in dir/my_site/books/... does not connect to my CSS page or my navigation.php page

 

 

Any ideas ??

 

Cheers

 

 

 

Link to comment
Share on other sites

Warning: include(my_site/navigation.php) [function.include]: failed to open stream: No such file or directory in /opt/lampp/htdocs/my_site/books/file.php on line 30

 

LINE 30 is :    <?php include("my_site/navigation.php"); ?>

 

LINUX Server

 

Thank you for the reply

 

Link to comment
Share on other sites

<?php include("my_site/navigation.php"); ?>

 

that should work for Linux

 

Did you give the folder correct permissions (chmod 777) I think is what is needed, if apache2 then make sure the user/group is www-data

 

Link to comment
Share on other sites

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.