Browse Source

Fix issue when SITE_PATH is /

master
Skylar Ittner 1 year ago
parent
commit
ef847a13c1
1 changed files with 6 additions and 1 deletions
  1. 6
    1
      index.php

+ 6
- 1
index.php View File

@@ -16,7 +16,12 @@ require_once __DIR__ . "/required.php";
<script src="<?php echo SITE_PATH; ?>js/bootstrap.min.js"></script>

<?php
$pathbits = explode("/", str_replace(SITE_PATH, "", $_SERVER['REQUEST_URI']));
$path = $_SERVER['REQUEST_URI'];
$pos = strpos($_SERVER['REQUEST_URI'], SITE_PATH);
if ($pos !== false) {
$path = substr_replace($_SERVER['REQUEST_URI'], "", $pos, strlen(SITE_PATH));
}
$pathbits = explode("/", $path);
$pageid = $pathbits[0];
$arg1 = isset($pathbits[1]) ? $pathbits[1] : "";
$arg2 = isset($pathbits[2]) ? $pathbits[2] : "";

Loading…
Cancel
Save