Jump to content

please need help with main folder


brooklynsweetone
Go to solution Solved by brooklynsweetone,

Recommended Posts

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 by brooklynsweetone
Link to comment
Share on other sites

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" ?>
  • Like 1
Link to comment
Share on other sites

  • Solution

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. 

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.