_simon_ Posted June 4, 2012 Share Posted June 4, 2012 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 https://forums.phpfreaks.com/topic/263634-directry-help/ Share on other sites More sharing options...
Skewled Posted June 4, 2012 Share Posted June 4, 2012 <?php include("../my_site/navigation.php"); ?> Give that a try.. windows or linux based server? They like to use different structures, it's been awhile since I messed with this.... Link to comment https://forums.phpfreaks.com/topic/263634-directry-help/#findComment-1351153 Share on other sites More sharing options...
_simon_ Posted June 5, 2012 Author Share Posted June 5, 2012 Quote 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 https://forums.phpfreaks.com/topic/263634-directry-help/#findComment-1351380 Share on other sites More sharing options...
Skewled Posted June 5, 2012 Share Posted June 5, 2012 <?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 https://forums.phpfreaks.com/topic/263634-directry-help/#findComment-1351458 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.