THE KHAN Posted June 12, 2008 Share Posted June 12, 2008 I want to call a function which is defined in an external file "includethis.php" to another file of my website. I tried this code <?php include('includethis.php'); ?> , but when i calls the function defined in "includethis.php" to current page, it displays an error "Call to undefined function". What to do for calling a function defined in an external file to current page? Link to comment https://forums.phpfreaks.com/topic/109962-solved-calling-function/ Share on other sites More sharing options...
ag3nt42 Posted June 12, 2008 Share Posted June 12, 2008 you should be able to call that function as long as the file is included before you call it Link to comment https://forums.phpfreaks.com/topic/109962-solved-calling-function/#findComment-564271 Share on other sites More sharing options...
THE KHAN Posted June 13, 2008 Author Share Posted June 13, 2008 you should be able to call that function as long as the file is included before you call it I included the code to include the file in the first line of the page , then also it is not possible. Link to comment https://forums.phpfreaks.com/topic/109962-solved-calling-function/#findComment-564517 Share on other sites More sharing options...
kranthi117 Posted June 13, 2008 Share Posted June 13, 2008 do u mind posting u r current code here Link to comment https://forums.phpfreaks.com/topic/109962-solved-calling-function/#findComment-564528 Share on other sites More sharing options...
bluejay002 Posted June 13, 2008 Share Posted June 13, 2008 yep... your code inside the inclusion statement where the function is defined and the code when you called the function. Link to comment https://forums.phpfreaks.com/topic/109962-solved-calling-function/#findComment-564529 Share on other sites More sharing options...
THE KHAN Posted June 13, 2008 Author Share Posted June 13, 2008 problem solved. Actually i defined a function newf() and called function new(). (spelling mistake). Link to comment https://forums.phpfreaks.com/topic/109962-solved-calling-function/#findComment-564535 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.