07-25-2017, 06:59 PM
<?php
session_start();
$abs_us_root=$_SERVER['DOCUMENT_ROOT'];
$self_path=explode("/", $_SERVER['PHP_SELF']);
$self_path_length=count($self_path);
$file_found=FALSE;
for($i = 1; $i < $self_path_length; $i++){
array_splice($self_path, $self_path_length-$i, $i);
$us_url_root=implode("/",$self_path)."/";
if (file_exists($abs_us_root.$us_url_root.'z_us_root.php')){
$file_found=TRUE;
break;
}else{
$file_found=FALSE;
}
}
require_once $abs_us_root.$us_url_root.'users/helpers/helpers.php';
// Set config
$GLOBALS['config'] = array(
'mysql' => array('host' => 'localhost',
'username' => 'Userspice',
'password' => 'Userspice',
'db' => 'userspice',
),
'remember' => array(
'cookie_name' => '',
'cookie_expiry' => 604800 //One week, feel free to make it longer
),
'session' => array(
'session_name' => 'user',
'token_name' => 'token',
)
);
session_start();
$abs_us_root=$_SERVER['DOCUMENT_ROOT'];
$self_path=explode("/", $_SERVER['PHP_SELF']);
$self_path_length=count($self_path);
$file_found=FALSE;
for($i = 1; $i < $self_path_length; $i++){
array_splice($self_path, $self_path_length-$i, $i);
$us_url_root=implode("/",$self_path)."/";
if (file_exists($abs_us_root.$us_url_root.'z_us_root.php')){
$file_found=TRUE;
break;
}else{
$file_found=FALSE;
}
}
require_once $abs_us_root.$us_url_root.'users/helpers/helpers.php';
// Set config
$GLOBALS['config'] = array(
'mysql' => array('host' => 'localhost',
'username' => 'Userspice',
'password' => 'Userspice',
'db' => 'userspice',
),
'remember' => array(
'cookie_name' => '',
'cookie_expiry' => 604800 //One week, feel free to make it longer
),
'session' => array(
'session_name' => 'user',
'token_name' => 'token',
)
);