View Full Version : [SHARE] Page system [PHP]

09-14-2013, 01:30 PM
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:

/admin/index.php and etc.

// 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

echo "<a href='"BASEDIR"index.php'>Home Direction</a>";

09-14-2013, 03:54 PM
Thanks for the share, good stuff.

09-14-2013, 05:30 PM
No problem, if need things like this, can ask :)
I'm happy that someone use my script :D

09-14-2013, 06:24 PM
Sharing is caring, thanks ;)

09-14-2013, 08:06 PM
Very nice, thanks for sharing!

09-17-2013, 10:23 AM
Thanks , Tommy. :)
Trying my best :D