include file from another subdomain

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

include file from another subdomain

Post by anjanesh »

I have a.php in main domain of httpdocs and b.php in a subdomain on the same server - I want to include a.php in b.php but it just doesnt include - I tried relative and document root paths but its not including.

In the subdomain file I gave
include_once ("../../../httpdocs/xxx.php");
to include a file from the main domain but thats isnt working.

Any way to get this done ?

Thanks
Last edited by anjanesh on Wed Jun 08, 2005 12:28 am, edited 1 time in total.
Syranide
Forum Contributor
Posts: 281
Joined: Fri May 20, 2005 3:16 pm
Location: Sweden

Post by Syranide »

if you can open it, include can include it... if you cannot open it... you cannot include it, the simple rules of include. make sure it is readable first.

and please try to be more precise with your tries, it's obvious you aren't trying too hard, alternatively not describing much at all of what goes wrong. include not working could be virtually anything, from a broken php, no file, no rights, could actually be working as far as I can tell.
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

I tried a lot - the path is correct and the file exists - Im just testing it.
It seems I cant access main domain's file from a sub-domain. I'll need to check the permissions I guess.
Post Reply