brooklynsweetone Posted August 31, 2022 Share Posted August 31, 2022 (edited) I am new to php and slowly learning can someone help me to show me how to do this issue? and explain for dumb people terms please lol.. I have a site my index page is on main site and then there is folders I have a folder include for my php nav ,footer, header etc which I understand i put <?php include('./include/nav.php') ?> to link any of those to pages on my main site. but now I have a folder named models and in that folder there is other folders example (folder called john) and in that folder john.php now I want to call on nav.php , footer.php, header.php from my include folder how do I do link it?? please help!!! Edited August 31, 2022 by brooklynsweetone Quote Link to comment https://forums.phpfreaks.com/topic/315257-please-need-help-with-main-folder/ Share on other sites More sharing options...
ginerjm Posted August 31, 2022 Share Posted August 31, 2022 Trying to read through your horrible English I would be hesitant to even try to explain any other language to you. Sorry, but if you think your paragraph makes sense you will have nothing but trouble in your programming career. Good luck. 1 Quote Link to comment https://forums.phpfreaks.com/topic/315257-please-need-help-with-main-folder/#findComment-1599932 Share on other sites More sharing options...
deepvyas Posted August 31, 2022 Share Posted August 31, 2022 You can use include function "<?php include 'header.php'; ?>" to achieve the same. 1 Quote Link to comment https://forums.phpfreaks.com/topic/315257-please-need-help-with-main-folder/#findComment-1599933 Share on other sites More sharing options...
cyberRobot Posted August 31, 2022 Share Posted August 31, 2022 It sounds like you are trying to access your scripts from different levels of your website hierarchy. For example, you want to access the nav.php script from your main root folder, as well as for the pages under the "models" and "john" folders. Is that correct? If that's the case, I would modify those include statements so that they are root relative. <?php include "{$_SERVER['DOCUMENT_ROOT']}/include/nav.php" ?> 1 Quote Link to comment https://forums.phpfreaks.com/topic/315257-please-need-help-with-main-folder/#findComment-1599934 Share on other sites More sharing options...
Solution brooklynsweetone Posted August 31, 2022 Author Solution Share Posted August 31, 2022 giner 10 hours ago, brooklynsweetone said: I am new to php and slowly learning can someone help me to show me how to do this issue? and explain for dumb people terms please lol.. I have a site my index page is on main site and then there is folders I have a folder include for my php nav ,footer, header etc which I understand i put <?php include('./include/nav.php') ?> to link any of those to pages on my main site. but now I have a folder named models and in that folder there is other folders example (folder called john) and in that folder john.php now I want to call on nav.php , footer.php, header.php from my include folder how do I do link it?? please help!!! but being a dick is a different language also??? regardless of how i spelt what i spelt. some understood what I was tying to say. it was 5am my time and i was tired. and im not a programmer im trying to fix my site on my own and learn. So thanks for your useless post. so much for the php community love. Quote Link to comment https://forums.phpfreaks.com/topic/315257-please-need-help-with-main-folder/#findComment-1599940 Share on other sites More sharing options...
brooklynsweetone Posted August 31, 2022 Author Share Posted August 31, 2022 thank you so much it work and you was kind about my sloppy writing. thank you so much Quote Link to comment https://forums.phpfreaks.com/topic/315257-please-need-help-with-main-folder/#findComment-1599941 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.