• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

[SHARE] Page system [PHP]

Vitrex

Moderator
Hello, Emudevs ! few days ago i needed that system and created simple paging script, that allows you make defines like BASEDIR,ADMIN,TEMPLATE and etc with values:

/index.php
/admin/index.php and etc.

Code:
<?php
// script start
$way = "";
$i = 0;
while (!file_exists($way."links.php")) {
$way .= "../"; $i++;
if ($i == 7) {
die("Wrong directory."); // error if file not found.
}
}
// Script end
// Defines
define ("BASEDIR", $way); // Main directory (root)
define("ADMIN", $way."Admin/"); // example define with value "ADMIN"
?>

This "script" allows you to make link to your main folder like this.
For example you in admin panel www.yourwebsite.com/Admin/forum_edit.php
You easy can create link like
Code:
echo "<a href='"BASEDIR"index.php'>Home Direction</a>";
 
Last edited:
Top