I know that itβs stupid to do, but I have a situation where I create a menu in different folders. And I tried to create baseurl for the menu.
function getBaseUrl() { $currentPath = $_SERVER['PHP_SELF']; $pathInfo = pathinfo($currentPath); $hostName = $_SERVER['HTTP_HOST']; $protocol = strtolower(substr($_SERVER["SERVER_PROTOCOL"],0,5))=='https://'?'https://':'http://'; return $protocol.$hostName.$pathInfo['dirname']."/"; }
Use the base url as <?php echo getBaseUrl(); ?>
<?php echo getBaseUrl(); ?>
. My problem:
Let me have aaa bbb ccc ddd menu. And the aaa
menu page is inside folder1/page1.php
The bbb
page is inside folder2/page2.php
. I cannot go from aaa
to bbb
menu.
Does anyone have an idea? please suggest
user5863306
source share