ilikephp Posted April 12, 2008 Share Posted April 12, 2008 Hello, In my web page when I put all the files in the root I use this script: <?PHP include "menu.php"; ?> And everythink is OK. What can I do please if my files are inside folders?? This is an example: I dont think it is correct because nothing is appearing What is wrong with this script? <?PHP include "english/SubPage/menu/menu.php"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/100849-php-include-script/ Share on other sites More sharing options...
dark_mirage Posted April 12, 2008 Share Posted April 12, 2008 Maybe an initial / would fix it, ie, <?PHP include "/english/SubPage/menu/menu.php"; ?> if not, how about trying the full url: <?PHP include "http://www.yoursite.com/english/SubPage/menu/menu.php"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/100849-php-include-script/#findComment-515714 Share on other sites More sharing options...
ilikephp Posted April 12, 2008 Author Share Posted April 12, 2008 Thanks. this code works: Code: <?PHP include "http://www.yoursite.com/english/SubPage/menu/menu.php"; ?> but I am trying to put it inside the index.php, nothing is happening!! what can I do plzz? Quote Link to comment https://forums.phpfreaks.com/topic/100849-php-include-script/#findComment-515715 Share on other sites More sharing options...
dark_mirage Posted April 12, 2008 Share Posted April 12, 2008 But you just said that the code is working ??? Stupid question... have u replaced 'www.yoursite.com' with your websites actual URL? Quote Link to comment https://forums.phpfreaks.com/topic/100849-php-include-script/#findComment-515717 Share on other sites More sharing options...
ilikephp Posted April 12, 2008 Author Share Posted April 12, 2008 oupss!!! I am sorry, I tried: http://www.yoursite.com/english/SubPage/menu/menu.php and it works! but now: I tried to put this link inside the index.php file <?PHP include "http://www.yoursite.com/english/SubPage/menu/menu.php"; ?> and nothing is happening Quote Link to comment https://forums.phpfreaks.com/topic/100849-php-include-script/#findComment-515719 Share on other sites More sharing options...
dezkit Posted April 12, 2008 Share Posted April 12, 2008 index.php <?php include "http://www.yoursite.com/english/SubPage/menu/menu.php"; ?> menu.php MENU IN HERE Quote Link to comment https://forums.phpfreaks.com/topic/100849-php-include-script/#findComment-515720 Share on other sites More sharing options...
dark_mirage Posted April 12, 2008 Share Posted April 12, 2008 index.php <?PHP include "http://www.yoursite.com/english/SubPage/menu/menu.php"; ?> menu.php MENU IN HERE I think he has already got that far, i think what he is saying, is that even with that code, the file is still not being included, im out of ideas sorry. Quote Link to comment https://forums.phpfreaks.com/topic/100849-php-include-script/#findComment-515723 Share on other sites More sharing options...
dezkit Posted April 12, 2008 Share Posted April 12, 2008 You never know. I don't know, but I think you can't use <?PHP instead you use <?php Quote Link to comment https://forums.phpfreaks.com/topic/100849-php-include-script/#findComment-515724 Share on other sites More sharing options...
ilikephp Posted April 12, 2008 Author Share Posted April 12, 2008 no, it is the same, I tried it, the problem is that in the menu section I receive blank area. and when I put the whole code in the Address bar, I receive the menu. In the index.php nothing happens Quote Link to comment https://forums.phpfreaks.com/topic/100849-php-include-script/#findComment-515727 Share on other sites More sharing options...
ilikephp Posted April 12, 2008 Author Share Posted April 12, 2008 when I put the menu.php file next to the index.php file, the link will become: <?PHP include "menu.php"; ?> IT works, but putting menu inside a folder, nothing is happening Quote Link to comment https://forums.phpfreaks.com/topic/100849-php-include-script/#findComment-515729 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.