Hi, I am writing a PHP app for domain1.com that would like to use a php file located on domain2.com domain1.com code: require_once('http://www.domain2.com/config.php'); domain2.com/config.php code: <$php class ClsMe { // Here's a comment var $sName = ''; function ClsMe ($in_sName) { $this->sName = $in_sName; } // End of constructor } $myvar = "Hi All"; $> Code (markup): This works when I'm on the same domain and use just config.php. This doesn't seem to work when I go across domains. I am using 1and1 for a hosting provider for both domains. Help!
If it's on the same hosting account, you could [possibly] try including it via the absolute path. /path/to/account/www/domain2/ etc...
Woudn't be better host your configuration file on domain2 and call such file from an include outside your main PHP coding? I do such thing sharing layout elements across multiple domains
Woo hoo! Thanks for the suggestion. I'd still like to find a solution for across different servers/accounts.