Jump to content

Two Domains Same Header and Footer Files?


Recommended Posts

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

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.

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

 

 

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.