RedBoffin Posted November 28, 2006 Share Posted November 28, 2006 Hello,I have one website on its own domain which has a collection of functions in a php file.I want to have four other websites (on their own domains) that include this functions php file, so that I only have to maintain the one set of functions. All four websites display the same products but each is branded differently.I have tried to include the functions file in one of the four websites using include() and no error message is displayed. A call from this website to one of the functions in the functions php file generates this error "Fatal error: Call to undefined function: getintroduction() in /home/hbash/public_html/includes/home.php on line 1".The first website also calls this function (in an identical manner) and does not generate an error message - it works as intended.I do not understand why the second website is having problems. Can anyone help me sort this problem out.Thank you for reading this.Darren Link to comment https://forums.phpfreaks.com/topic/28729-how-do-i-include-a-php-file-on-one-domain-into-another/ Share on other sites More sharing options...
AbydosGater Posted November 28, 2006 Share Posted November 28, 2006 As far as i know there is NO way to do this... for security. Ie: your config files variables can only be called from your domain.. not anywhere. Link to comment https://forums.phpfreaks.com/topic/28729-how-do-i-include-a-php-file-on-one-domain-into-another/#findComment-131544 Share on other sites More sharing options...
Psycho Posted November 28, 2006 Share Posted November 28, 2006 It is possible. But, you cannot give the file an extension such as PHP. If you do then when you call the file from an external page then the page will be processed by the web server and the result will be returned to the calling page. So, if you are declaring function in the include file, there is no output.Instead, you need to give the file an extension that the server will not process such as txt or something of your own choosing - doesn't really matter as long as it's not something the server will process. Link to comment https://forums.phpfreaks.com/topic/28729-how-do-i-include-a-php-file-on-one-domain-into-another/#findComment-131560 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.