Jump to content

[SOLVED] What's the Issue here?


Cardale

Recommended Posts

This is the basic idea.

 

This is the code and it does what I need for now.

if(isset($_SERVER['SCRIPT_NAME'])){
$Root = strtok($_SERVER['SCRIPT_NAME'], 'root.php');
$Root = strtok($_SERVER['SCRIPT_NAME'], $Root);
define(Root, true);
}else{
define(Root, false);
}

 

Here is my function inside my class that doesn't work.

<?php
class LOAD{

var $classload = array();
var $baseurl;
var $locate = array();
var $located;
var $path;
var $file; 


function LOCATOR($locate, $path){

	$directory_map = array('ROOT'  =>   'root.php');

	if(isset($path)){
		$file = strtok($path, $directory_map[$locate]);
		$file = strtok($path, $file);
		define($located, true);
		echo $file;
		echo "done";
	}else{
		define($located, false);
		echo "done";
	}
}
}
?>

 

Here is how I call it.

$MAGI->LOCATOR('ROOT', $_SERVER['SCRIPT_NAME']);

 

Not getting a error or anything just getting no output.

 

Any help appreciated.

Link to comment
https://forums.phpfreaks.com/topic/77272-solved-whats-the-issue-here/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.