$fileInfo = explode("/", $_SERVER['REQUEST_URI']); $fileName = $fileInfo[count($fileInfo)-1]; $folderName = $fileInfo[count($fileInfo)-2]; ?>