OInter Posted December 13, 2006 Share Posted December 13, 2006 How do I use includes in my pages residing in the subdomain of my main site?like this http://subdomain.mysite.comthe includes work fine on the main domain, but I cannot figure out how to get includes to work for the subdomain pages (i use plesk for my host)am I missing something in my understanding of what works with subdomains? Link to comment https://forums.phpfreaks.com/topic/30461-php-includes-and-subdomains-how-do-they-work/ Share on other sites More sharing options...
kayess2004 Posted December 13, 2006 Share Posted December 13, 2006 Hi OInter,Usually a subdomain is just a folder beneath the root directory,for example http://subdomain.mysite.com would be something like/home/mysite/subdomain/ where the root directory is /home/mysite/To find out what your root directory is you can use $_SERVER['DOCUMENT_ROOT'].Or you could use include($_SERVER['DOCUMENT_ROOT']."/subdomain/myfile.php");Hope this helps Link to comment https://forums.phpfreaks.com/topic/30461-php-includes-and-subdomains-how-do-they-work/#findComment-140315 Share on other sites More sharing options...
OInter Posted December 14, 2006 Author Share Posted December 14, 2006 I have a directory structure like this:/httpdocs/index.php <----- for mainsite/subdomains/[subdomain_name]/httpdocs/index.php <----- for subdomainand it's shared hosting. T_T Link to comment https://forums.phpfreaks.com/topic/30461-php-includes-and-subdomains-how-do-they-work/#findComment-140829 Share on other sites More sharing options...
trq Posted December 14, 2006 Share Posted December 14, 2006 Then it would be...[code]include $_SERVER['DOCUMENT_ROOT']."/subdomains/[subdomain_name]/httpdocs/yourinclude.php";[/code] Link to comment https://forums.phpfreaks.com/topic/30461-php-includes-and-subdomains-how-do-they-work/#findComment-140830 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.