Cardale Posted November 14, 2007 Share Posted November 14, 2007 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. Quote Link to comment Share on other sites More sharing options...
Lumio Posted November 14, 2007 Share Posted November 14, 2007 did you create an instance? $MAGI =& new LOAD; If that also doesn't work try to put error_reporting(E_ALL); Quote Link to comment Share on other sites More sharing options...
Cardale Posted November 15, 2007 Author Share Posted November 15, 2007 Yes and when I do the error reporting I get nothing. I even tried putting the code into a function and that didn't work. Quote Link to comment Share on other sites More sharing options...
Lumio Posted November 15, 2007 Share Posted November 15, 2007 Did you set display_errors to On in you php.ini? Maybe set_ini("display_errors", true); will help. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.