文件位置问题

I have a navbar on each page a footer and css etc. I have put a php file 2 folder in so raffles/page/pagetemp.php because this is a template for more files that will be created later and this is for more order so it wont all get cluttered into 1 file.

I used include '../../navbar.php'; to make it include the navbar into the file as well wich works beautifully, but the problem is now the href on the navbar are all direct links to the file so for example index.php When I click on the buttons in the pagetemp.php they don't direct me into the main folders index. They try to find a index in the folder I'm in now, same with images.

I cannot start adding ../../ in front of all the links because then the other pages wouldn't work. How can I solve this problem is there for example "host/index.php" so then it would always know to look into the host folder?

<!-- example of a button in the navbar located in the host folder -->
<a href="raffles.php"><p class="button">Raffles</p></a>

<!-- what I am using to include the navbar into the pagetemp.php located in host/raffles/page-->
<?php include '../../navbar.php';?>

I apolagise if this is confusing if you have any questions please comment so I can answer them.

</div>

Usually I use $_SERVER['DOCUMENT_ROOT']

include($_SERVER['DOCUMENT_ROOT'] . '/folder/navbar.php');

Than simply define the folder structure starting from the root. This way it becomes a relative path and should work on every page you put it