chai Posted May 24, 2006 Share Posted May 24, 2006 Hi,I am trying to write often-used code snippets such as add, edit,delete function and place them infunctions.phpSo, whenever I need to use them, I can just call then up and pass parameters to them.I am able to call a function that is inside the same page it is called.But, how do I call a function that is in another file.I've read about the include() function, but it doen't perform what I wanted.Any ideas? Link to comment https://forums.phpfreaks.com/topic/10361-calling-function-from-another-file/ Share on other sites More sharing options...
chrisbcats Posted May 24, 2006 Share Posted May 24, 2006 <?php require 'file_name.php';?><html><head><body>......<?phpfunction_name();?>......... Link to comment https://forums.phpfreaks.com/topic/10361-calling-function-from-another-file/#findComment-38630 Share on other sites More sharing options...
micah1701 Posted May 24, 2006 Share Posted May 24, 2006 include('functionScript.php');//will include the function. then just call the function.myFunction();//maybe you can post some code//so we can see why this isn't working.//it should Link to comment https://forums.phpfreaks.com/topic/10361-calling-function-from-another-file/#findComment-38631 Share on other sites More sharing options...
chai Posted May 25, 2006 Author Share Posted May 25, 2006 It is working now.. I was messing with the .ini file..don't know whether if this the cause :pI am rather stuck in the session object thoughgoing through tutorial as i am writing this..Thanks. Link to comment https://forums.phpfreaks.com/topic/10361-calling-function-from-another-file/#findComment-38964 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.