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. Link to comment https://forums.phpfreaks.com/topic/77272-solved-whats-the-issue-here/ 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); Link to comment https://forums.phpfreaks.com/topic/77272-solved-whats-the-issue-here/#findComment-391208 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. Link to comment https://forums.phpfreaks.com/topic/77272-solved-whats-the-issue-here/#findComment-391870 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. Link to comment https://forums.phpfreaks.com/topic/77272-solved-whats-the-issue-here/#findComment-391982 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.