tetuanrp Posted May 14, 2007 Share Posted May 14, 2007 I'm loading in an external script: <?php require_once('http://www.mysite.com/php/check_session.php'); checkSession('test'); ?> And my check_session.php file is this: <?php function checkSession($sessName) { echo $sessName; } echo 'function loaded'; ?> Why would I be getting this? It's clearly defined and I'm calling it after I loaded in the check_session.php file (and I'm getting my echo test as well, so I know it's not a targetting issue): Fatal error: Call to undefined function: checksession() in base.php on line 4 Link to comment https://forums.phpfreaks.com/topic/51363-solved-call-to-undefined-function/ Share on other sites More sharing options...
kenrbnsn Posted May 14, 2007 Share Posted May 14, 2007 You don't want to use a full URL when including a local file, just use the local file name. <?php require_once('php/check_session.php'); checkSession('test'); ?> Ken Link to comment https://forums.phpfreaks.com/topic/51363-solved-call-to-undefined-function/#findComment-252929 Share on other sites More sharing options...
tetuanrp Posted May 14, 2007 Author Share Posted May 14, 2007 Thanks Ken, Anyway I can make the require statement an absolute path instead? Would make a few other things easier. -R Link to comment https://forums.phpfreaks.com/topic/51363-solved-call-to-undefined-function/#findComment-252931 Share on other sites More sharing options...
kenrbnsn Posted May 14, 2007 Share Posted May 14, 2007 You can use a absolute path as long as the path is local to the server. Ken Link to comment https://forums.phpfreaks.com/topic/51363-solved-call-to-undefined-function/#findComment-252940 Share on other sites More sharing options...
tetuanrp Posted May 14, 2007 Author Share Posted May 14, 2007 Got it. Thx Link to comment https://forums.phpfreaks.com/topic/51363-solved-call-to-undefined-function/#findComment-252942 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.