Forum Moderators: coopster
This works fine
however
when I upload the top_banner.inc file to domain2.com and then try to include that file in from the 2nd domain the banner is just not showing
Domain.com code:
("http://www.domain2.com/top_banner.inc");?>
Is is possible to execute a php include from another domain?
So while executing include from domain2 there's no such file. What you have to do is include the file from www.domain.com.
The real problem is that you mix two things together: uploading the file to domain2 and uploading the file to client.
other option is to make an upload to server script, it will require writing into a file.
Hope this cleares the mess a bit. if you need a specific script for file write just post it here.
Best regards
Michal Cibor
a follow up question
if I name my include topbanner.inc the php code at [domain2.com...] is viewable
If I name the include file topbanner.php the script exicutes on domain2.com rather than domain.com.
Is there a way to:
1) hide the php in the include file if the direct url is know and then also only allow it to exicute on domain.com?
//Untested example
if($_SERVER[REMOTE_ADDR] == "yourdomain_ip")
{
//echo your formatted php code
$code = <<<EOF
<?php
echo "hello world";
?>
EOF;
echo $code;
}
else
{
die("nothing to see here");
}
Cheers