spectacularstuff Posted May 16, 2008 Share Posted May 16, 2008 Is is possible to have two domains with the same header and footer files stored on 1 domain? I have attempted the require_once('') and the include('') via the http protocol and I cannot get the header to show up. It doesn't even pay attention to the PHP code. It merely ignores it. If this is possible how would I do this? Should I store a reference to it in a database and have it called from the database or is there an easier way? Thanks, Wayne Link to comment https://forums.phpfreaks.com/topic/105878-two-domains-same-header-and-footer-files/ Share on other sites More sharing options...
cooldude832 Posted May 16, 2008 Share Posted May 16, 2008 first go figure out what a domain is and then realize your question is already been answered by your own response. Link to comment https://forums.phpfreaks.com/topic/105878-two-domains-same-header-and-footer-files/#findComment-542612 Share on other sites More sharing options...
spectacularstuff Posted May 16, 2008 Author Share Posted May 16, 2008 I know what a domain is but I don't see the answer. Link to comment https://forums.phpfreaks.com/topic/105878-two-domains-same-header-and-footer-files/#findComment-542619 Share on other sites More sharing options...
cooldude832 Posted May 16, 2008 Share Posted May 16, 2008 a domain is nothing more than a database entry relating a name to a location its your address (123 fake street). require/include/require_once are functions that by design want to use the servers internal pointer system not the external protocols such as http://www.mysite.com/config.php instead of $_SERVER['DOCUMENT_ROOT']."/config.php" reason being is it has to have proper CHMOD as the "server" to access the file. You cause a security flaw when you use the external pointer system because you have to release control to the file so to speak. The answer is if both domains are hosted under the same server (i.e a duplex home or apartment) then you can share internal pointer resources if you are careful. The external pointers can only be used if you have the proper chmod to the files, but then any one has access to them unless you do it right. Link to comment https://forums.phpfreaks.com/topic/105878-two-domains-same-header-and-footer-files/#findComment-542621 Share on other sites More sharing options...
spectacularstuff Posted May 16, 2008 Author Share Posted May 16, 2008 Okay, Now presuming that both domains are on different servers, how do I get domain A to use domain B's header file? I was also looking into the header() function. header('Location: http://www.example.com/'); I figure worse case scenario, I should be able to store a reference in a database table and have the domain A access the database and utilize the reference however I don't know if that will work either. That is what I am attempting to find out here. Thanks for the quick response. Wayne Link to comment https://forums.phpfreaks.com/topic/105878-two-domains-same-header-and-footer-files/#findComment-542626 Share on other sites More sharing options...
cooldude832 Posted May 16, 2008 Share Posted May 16, 2008 your probably going with to authenticate server B to server A using some method such as by its IP. Allowing that IP into the "GROUP" of chmod and setting the file to 0X77 where X is what you want for public and 77 are the server and the group Edit: the header function is a lot more universal and that works for the redirect because it doesn't need to have access to a file to direct a user to it Link to comment https://forums.phpfreaks.com/topic/105878-two-domains-same-header-and-footer-files/#findComment-542628 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.