homepage Welcome to WebmasterWorld Guest from 54.145.209.80
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
require once from subdomain to domain
7miles

5+ Year Member



 
Msg#: 3776761 posted 3:01 pm on Oct 30, 2008 (gmt 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 ?

 

stuartc1

10+ Year Member



 
Msg#: 3776761 posted 3:13 pm on Oct 30, 2008 (gmt 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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved