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? Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment 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). 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.