dphil311 Posted April 18, 2007 Share Posted April 18, 2007 For some reason I've been having difficulty trying to echo a path from my database. I'm running mySQL 3.23 and PHP 4+ Here's a test file: http://pack1705.com/calendar/test.php Here's the code: <?php echo 'Document root: '.$_SERVER['DOCUMENT_ROOT'].'<br />'; echo 'Path: '.$sem_config['path'].'<br />'; echo 'Path: '.$sem_config['news_url'].'<br />'; echo 'Path: '.$sem_users['full_name'].'<br />'; ?> As you can see, it is not calling any information from the database. However the call function seems to be working with "Document root." I'm not sure what is going on. Maybe this will help someone point me in the right direction. Thanks in advance, Duane Link to comment https://forums.phpfreaks.com/topic/47553-path-not-recognized/ Share on other sites More sharing options...
Glyde Posted April 18, 2007 Share Posted April 18, 2007 I can't help since I'm unaware to see where $sem_config is defined...however, you may be able to try: <?php print "Path: " . $_SERVER['DOCUMENT_ROOT'] . $_SERVER['PHP_SELF']; ?> Link to comment https://forums.phpfreaks.com/topic/47553-path-not-recognized/#findComment-232101 Share on other sites More sharing options...
dphil311 Posted April 18, 2007 Author Share Posted April 18, 2007 I can't help since I'm unaware to see where $sem_config is defined...however, you may be able to try: I guess I should have mentioned that I'm the guy who knows just enough to make himself dangerous. So with that said, what kind of (specific) information do you need with $sem_config? Basically I've created a test script to help me identify the problem within a calendar script. Thanks! Duane Link to comment https://forums.phpfreaks.com/topic/47553-path-not-recognized/#findComment-232118 Share on other sites More sharing options...
Glyde Posted April 18, 2007 Share Posted April 18, 2007 Where exactly in your script to you set $sem_config to some array? I'll need to see that. I'm assuming it's in a config.php that is included using include or require? But either way, I'll need to see it. Link to comment https://forums.phpfreaks.com/topic/47553-path-not-recognized/#findComment-232120 Share on other sites More sharing options...
dphil311 Posted April 18, 2007 Author Share Posted April 18, 2007 Where exactly in your script to you set $sem_config to some array? I'll need to see that. I'm assuming it's in a config.php that is included using include or require? But either way, I'll need to see it. Okay, here we go Here's the original error message: http://www.pack1705.com/calendar/events.php Here's the Line 12-16 of the code: require $_SERVER['DOCUMENT_ROOT']."/".$sem_config['path']."admin/config.php"; $langfile = $_SERVER['DOCUMENT_ROOT']."/".$sem_config['path']."languages/".$lang.".lang.php"; $default = $_SERVER['DOCUMENT_ROOT']."/".$sem_config['path']."languages/english.lang.php"; if (file_exists($langfile)) include $langfile; else include $default; Hope this helps...thanks. Duane Link to comment https://forums.phpfreaks.com/topic/47553-path-not-recognized/#findComment-232129 Share on other sites More sharing options...
Glyde Posted April 18, 2007 Share Posted April 18, 2007 Still not seeing where $sem_config is defined...At some point in your script you must have done something like: $sem_config = array(...); Link to comment https://forums.phpfreaks.com/topic/47553-path-not-recognized/#findComment-232131 Share on other sites More sharing options...
dphil311 Posted April 18, 2007 Author Share Posted April 18, 2007 Still not seeing where $sem_config is defined...At some point in your script you must have done something like: $sem_config = array(...); Sorry, I'm not finding anything like that in any of the pages. Thanks for the help. Blessings! Duane Link to comment https://forums.phpfreaks.com/topic/47553-path-not-recognized/#findComment-232146 Share on other sites More sharing options...
Glyde Posted April 18, 2007 Share Posted April 18, 2007 That's your problem. You're trying to access the variable $sem_config which has never been defined. Check your config.php file and make sure it's not there. If it isn't, that is why this doesn't work for you. Link to comment https://forums.phpfreaks.com/topic/47553-path-not-recognized/#findComment-232152 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.