1
I have in my root folder my index php.. I also have, in my root folder, another folder called components.
Inside the folder components, I have a file called php menu., containing the site menu codes.
I want to include the menu file in my index. When I do this - using the code below - it opens, but with the wrong links.
<?php include "componentes/menu.php";?>
For example:
In the php menu. is
<ul>
<a href="../index.php"> <li>home<li> </a>
<ul>
The link above will open normally, but if I "pull" the file php menu. in another directory, will give error because of the ../index.php
Vlw I’ll do a little research on that, we’ll do it together!
– Matheus Valverde Lisboa
Not at all, friend ><
– Angelo Soares
consequi do, the more the link problem continues! if I create another folder at the root and create a file Nala and pull up the menu.php, will give error link
– Matheus Valverde Lisboa
in the start menu I put <a href=". /index.php"> when I pulled on index.php it was perfect! more if I create another folder at the root, and create a file Nala, and pull up the menu.php the menu directory changes relative to that new folder!
– Matheus Valverde Lisboa
Friend, it is this way because the menu should be pulled only in the files of the site root. Unless you leave the menu file inside the main root instead of the component folder. Try this
– Angelo Soares
got it! what you’re not able to do! I’ll leave the menu next to the index thanks for everything! S2
– Matheus Valverde Lisboa