Sabrin
asked on
include page with domain
hello,
I have many domains and I would like to include a page
that if comes from domain1.com or domain2.com
make it like this
<? include("http://domain1.com/footer.php"); ?>
<? include("http://domain2.com/footer.php"); ?>
how can i do this?
I have many domains and I would like to include a page
that if comes from domain1.com or domain2.com
make it like this
<? include("http://domain1.com/footer.php"); ?>
<? include("http://domain2.com/footer.php"); ?>
how can i do this?
ASKER
<? include("DOMAIN WHERE YOU CAME FROM/footer.php"); ?>
ASKER
instead of this
<? include($_SERVER["DOCUMENT _ROOT"]."/ galleries/ main/heade r.php"); ?>
/home/etc/site/galleries/m ain/header .php
i want something like this
<? include($_SERVER["DOMAIN"] ."/galleri es/main/he ader.php") ; ?>
http://domain.com/galleries/main/header.php
<? include($_SERVER["DOCUMENT
/home/etc/site/galleries/m
i want something like this
<? include($_SERVER["DOMAIN"]
http://domain.com/galleries/main/header.php
ASKER
<? include($_SERVER["HTTP_HOS T"]."/gall eries/main /header.ph p"); ?>
only shows this
domain.com/galleries/main/ header.php
I need the http://
only shows this
domain.com/galleries/main/
I need the http://
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If you want domain1.com to include the file domain1.com/footer.php, but domain2.com to include the file domain2.com/footer.php using the same code, then could you use this:
include('/footer.php');
That uses an absolute path that looks for footer.php in the root directory. So if the current script is in the space for domain1.com, then PHP should ask for domain1.com/footer.php and so on. I think that would work even if the domains were on the same server. (So long as the domains didn't point to the same directory.)