Welcome to WebmasterWorld Guest from 54.160.221.82

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

require once from subdomain to domain

     
3:01 pm on Oct 30, 2008 (gmt 0)

New User

5+ Year Member

joined:Oct 26, 2008
posts: 4
votes: 0


Hi,
I need to use require_once from subdomain to domain.
I mean:
I have stats.php in http//subdomain.domain.com and it should add a require_once command to global.php that stay in http//domain.com

How can i do it ?

3:13 pm on Oct 30, 2008 (gmt 0)

Full Member

10+ Year Member

joined:Feb 19, 2003
posts:227
votes: 0


If the subdomain is hosted as a physical subdirectory of the main directory (as some hosts do) then just do something like:

<?php
include_once 'subdomainpath/file.php';
?>

You can like relatively or absolutley from the user root (i.e. /home/domain/public_html/directory/file.php)

I strongly recommend not using a remove include - this option should probably be inactive for security reasons anyway.